summaryrefslogtreecommitdiffstats
path: root/package/irda-utils/irda-utils-0.9.18-daemon.patch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-12-08 00:07:16 -0500
committerPeter Korsgaard <jacmet@sunsite.dk>2011-01-14 13:25:34 +0100
commit86f2543c8ce2467847d397f52f570f0480b2f2a7 (patch)
treeb055bf14880b11ba22b4948a6e789cd9c200d1d3 /package/irda-utils/irda-utils-0.9.18-daemon.patch
parent921f75e2607e7f3d16b7ba8ee62ed68a3632eeb7 (diff)
downloadbuildroot-novena-86f2543c8ce2467847d397f52f570f0480b2f2a7.tar.gz
buildroot-novena-86f2543c8ce2467847d397f52f570f0480b2f2a7.zip
irda-utils: new package for IrDA devices
[Peter: Small tweaks, add patch descriptions] Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/irda-utils/irda-utils-0.9.18-daemon.patch')
-rw-r--r--package/irda-utils/irda-utils-0.9.18-daemon.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/package/irda-utils/irda-utils-0.9.18-daemon.patch b/package/irda-utils/irda-utils-0.9.18-daemon.patch
new file mode 100644
index 000000000..f6034a75b
--- /dev/null
+++ b/package/irda-utils/irda-utils-0.9.18-daemon.patch
@@ -0,0 +1,34 @@
+written by Mike Frysinger
+
+https://sourceforge.net/tracker/?func=detail&aid=3132053&group_id=5616&atid=305616
+
+Rather than using the fork function (which doesnt work on nommu
+systems), simply use the daemon() function instead (which does
+work). this should work the same before and after for all systems.
+
+--- a/irattach/util.c
++++ b/irattach/util.c
+@@ -156,21 +156,10 @@
+
+ void fork_now(int ttyfd)
+ {
+- int ret;
+ int i;
+
+- if ((ret = fork()) > 0)
+- exit(0);
+-
+- if (ret == -1)
+- syslog(LOG_INFO, "forking: %m");
+- if (setsid() < 0)
+- syslog(LOG_INFO, "detaching from tty: %m");
+-
+- if ((ret = fork()) > 0) {
+- /* cleanup_files = 0; */
+- exit(0);
+- }
++ if (daemon(1, 1))
++ syslog(LOG_INFO, "daemon: %m");
+
+ /* Close all open inherited files! Except for ttyfd! */
+ for (i = 0; i < 64; i++)