summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch')
-rw-r--r--sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch b/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch
new file mode 100644
index 000000000000..aecb5e7a9b7c
--- /dev/null
+++ b/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch
@@ -0,0 +1,31 @@
+Write a pid when we daemonize
+
+patch by Mike Frysinger
+
+--- mbmon.c
++++ mbmon.c
+@@ -229,4 +229,5 @@
+ static void daemonize()
+ {
++ pid_t pid;
+ int fd;
+ struct sigaction sa_ign, sa_save;
+@@ -247,5 +248,5 @@
+ sigaction(SIGHUP, &sa_ign, &sa_save);
+
+- switch (fork()) {
++ switch ((pid=fork())) {
+ case 0:
+ break;
+@@ -259,4 +260,11 @@
+
+ default:
++ {
++ FILE *f = fopen("/var/run/mbmon.pid", "w");
++ if (f != NULL) {
++ fprintf(f, "%i", pid);
++ fclose(f);
++ }
++ }
+ exit(0);
+ /* NOTREACHED */