aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/xfce4-genmon-plugin
diff options
context:
space:
mode:
authorehaupt <ehaupt@FreeBSD.org>2010-11-07 23:40:44 +0800
committerehaupt <ehaupt@FreeBSD.org>2010-11-07 23:40:44 +0800
commitd07808495b4e5de3fdc91f62cac03344882d311e (patch)
tree584a7db0ab11e4a3c9eb6fa1ec30d9e10c03b6b7 /sysutils/xfce4-genmon-plugin
parent2e034fd3f76997783580db8f28a046e05a1053f2 (diff)
downloadfreebsd-ports-gnome-d07808495b4e5de3fdc91f62cac03344882d311e.tar.gz
freebsd-ports-gnome-d07808495b4e5de3fdc91f62cac03344882d311e.tar.zst
freebsd-ports-gnome-d07808495b4e5de3fdc91f62cac03344882d311e.zip
PR: 152015
Submitted by: self
Diffstat (limited to 'sysutils/xfce4-genmon-plugin')
-rw-r--r--sysutils/xfce4-genmon-plugin/Makefile4
-rw-r--r--sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c33
-rw-r--r--sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__main.c32
3 files changed, 67 insertions, 2 deletions
diff --git a/sysutils/xfce4-genmon-plugin/Makefile b/sysutils/xfce4-genmon-plugin/Makefile
index a5c5a9d5e1b6..337c5a4b8d8c 100644
--- a/sysutils/xfce4-genmon-plugin/Makefile
+++ b/sysutils/xfce4-genmon-plugin/Makefile
@@ -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
diff --git a/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
new file mode 100644
index 000000000000..a7a3480187b2
--- /dev/null
+++ b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
@@ -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()
diff --git a/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__main.c b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__main.c
new file mode 100644
index 000000000000..d2491de0a1b7
--- /dev/null
+++ b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__main.c
@@ -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);
+ }
+
+ /**************************************************************/