From ehaupt@FreeBSD.org  Sun Nov  7 14:28:49 2010
Return-Path: <ehaupt@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 299371065674
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Nov 2010 14:28:49 +0000 (UTC)
	(envelope-from ehaupt@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 175488FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Nov 2010 14:28:49 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA7ESmo6094989
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 7 Nov 2010 14:28:48 GMT
	(envelope-from ehaupt@freefall.freebsd.org)
Received: (from ehaupt@localhost)
	by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA7ESmW4094976;
	Sun, 7 Nov 2010 15:28:48 +0100 (CET)
	(envelope-from ehaupt)
Message-Id: <201011071428.oA7ESmW4094976@freefall.freebsd.org>
Date: Sun, 7 Nov 2010 15:28:48 +0100 (CET)
From: Emanuel Haupt <ehaupt@freebsd.org>
Reply-To: Emanuel Haupt <ehaupt@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] sysutils/xfce4-genmon-plugin - fix with current xfce4 version
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         152015
>Category:       ports
>Synopsis:       [patch] sysutils/xfce4-genmon-plugin - fix with current xfce4 version
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 07 14:30:17 UTC 2010
>Closed-Date:    Sun Nov 07 16:44:18 CET 2010
>Last-Modified:  Sun Nov 07 19:56:39 UTC 2010
>Originator:     Emanuel Haupt
>Release:        FreeBSD 8.1-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #44 r209978: Tue Jul 13 08:42:03 UTC 2010 simon@freefall.freebsd.org:/usr/src/sys/i386/compile/FREEFALL i386


	
>Description:
The current version of sysutils/xfce4-genmon-plugin crashes immediately when the
initial configuration dialog is closed.

I extracted the relevant patches from the debian lenny package base. After
applying the patches sysutils/xfce4-genmon-plugin works again as expected.

>How-To-Repeat:
	
>Fix:

	

--- xfce4-genmon-plugin.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/xfce4-genmon-plugin/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile	31 May 2010 15:27:26 -0000	1.30
+++ Makefile	7 Nov 2010 10:35:59 -0000
@@ -7,9 +7,9 @@
 
 PORTNAME=	xfce4-genmon-plugin
 PORTVERSION=	3.2
-PORTREVISION=	9
+PORTREVISION=	10
 CATEGORIES=	sysutils xfce
-MASTER_SITES=	http://goodies.xfce.org/releases/${PORTNAME}/
+MASTER_SITES=	CRITICAL/xfce4
 DIST_SUBDIR=	xfce4
 
 MAINTAINER=	miwi@FreeBSD.org
Index: files/patch-panel-plugin__cmdspawn.c
===================================================================
RCS file: files/patch-panel-plugin__cmdspawn.c
diff -N files/patch-panel-plugin__cmdspawn.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-panel-plugin__cmdspawn.c	7 Nov 2010 10:35:59 -0000
@@ -0,0 +1,33 @@
+--- ./panel-plugin/cmdspawn.c.orig	2007-11-23 16:32:40.000000000 +0100
++++ ./panel-plugin/cmdspawn.c	2010-11-07 11:29:03.000000000 +0100
+@@ -184,6 +184,7 @@
+             return (-1);
+         case 0:
+             /* Redirect stdout/stderr to associated pipe's write-ends */
++            close(0); /* stdin is not used in child */
+             for (i = 0; i < OUT_ERR; i++) {
+                 j = i + 1; // stdout/stderr file descriptor
+                 close (j);
+@@ -199,6 +200,9 @@
+         exit (-1);
+     }
+ 
++    for (i = 0; i < OUT_ERR; i++)
++        close (aaiPipe[i][WR]); /* close write end of pipes in parent */
++
+     /* Wait for child completion */
+     if (wait == 1)
+     {
+@@ -231,10 +235,9 @@
+     }
+ 
+     End:
+-    /* Close created pipes */
++    /* Close read end of pipes */
+     for (i = 0; i < OUT_ERR; i++)
+-        for (j = 0; j < RD_WR; j++)
+-            close (aaiPipe[i][j]);
++        close (aaiPipe[i][RD]);
+ 
+     return (-fError);
+ }// Spawn()
Index: files/patch-panel-plugin__main.c
===================================================================
RCS file: files/patch-panel-plugin__main.c
diff -N files/patch-panel-plugin__main.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-panel-plugin__main.c	7 Nov 2010 10:35:59 -0000
@@ -0,0 +1,32 @@
+--- ./panel-plugin/main.c.orig	2008-03-15 23:38:18.000000000 +0100
++++ ./panel-plugin/main.c	2010-11-07 11:28:17.000000000 +0100
+@@ -32,6 +32,7 @@
+ 
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/dialogs.h>
++#include <libxfcegui4/xfce-exec.h>
+ #include <libxfce4panel/xfce-panel-plugin.h>
+ #include <libxfce4panel/xfce-panel-convenience.h>
+ 
+@@ -94,10 +95,18 @@
+ {
+     struct genmon_t *poPlugin = (genmon_t *) p_pvPlugin;
+     struct monitor_t *poMonitor = &(poPlugin->oMonitor);
+-    char result[256];
++    GError *error = NULL;
++
++	xfce_exec(poMonitor->onClickCmd, 0, 0, &error);
++    if (error) {
++        char first[256];
++        g_snprintf (first, sizeof(first), _("Could not run \"%s\""), poMonitor->onClickCmd);
++        xfce_message_dialog (NULL, _("Xfce Panel"), 
++                             GTK_STOCK_DIALOG_ERROR, first, error->message,
++                             GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL);
++        g_error_free (error);
++    }
+ 
+-    genmon_SpawnCmd (poMonitor->onClickCmd, result,
+-        sizeof (poMonitor->onClickCmd), 0);
+ }
+ 
+ /**************************************************************/
--- xfce4-genmon-plugin.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Sun Nov 7 16:44:17 CET 2010 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152015 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/152015: commit references a PR
Date: Sun,  7 Nov 2010 15:40:50 +0000 (UTC)

 ehaupt      2010-11-07 15:40:44 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/xfce4-genmon-plugin Makefile 
   Added files:
     sysutils/xfce4-genmon-plugin/files 
                                        patch-panel-plugin__cmdspawn.c 
                                        patch-panel-plugin__main.c 
   Log:
   PR:             152015
   Submitted by:   self
   
   Revision  Changes    Path
   1.31      +2 -2      ports/sysutils/xfce4-genmon-plugin/Makefile
   1.1       +33 -0     ports/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c (new)
   1.1       +32 -0     ports/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__main.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/152015: commit references a PR
Date: Sun,  7 Nov 2010 15:43:06 +0000 (UTC)

 ehaupt      2010-11-07 15:43:01 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/xfce4-genmon-plugin Makefile distinfo pkg-descr 
                                  pkg-plist 
   Log:
   Forced commit to state, that the previous commit should read:
   
   The current version of sysutils/xfce4-genmon-plugin crashes immediately when the
   initial configuration dialog is closed.
   
   Merge relevant patches from the debian lenny package base.
   
   Also update outdated MASTER_SITE.
   
   PR:             152015
   Submitted by:   self
   Approved by:    miwi (maintainer)
   Obtained from:  debian
   
   Revision  Changes    Path
   1.32      +0 -0      ports/sysutils/xfce4-genmon-plugin/Makefile
   1.9       +0 -0      ports/sysutils/xfce4-genmon-plugin/distinfo
   1.3       +0 -0      ports/sysutils/xfce4-genmon-plugin/pkg-descr
   1.9       +0 -0      ports/sysutils/xfce4-genmon-plugin/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Nov 7 19:56:38 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152015 
>Unformatted:
