python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / irda-utils / 0001-daemon.patch
blobf6034a75b446473e28636d3499c41f06db2713df
1 written by Mike Frysinger
3 https://sourceforge.net/tracker/?func=detail&aid=3132053&group_id=5616&atid=305616
5 Rather than using the fork function (which doesnt work on nommu
6 systems), simply use the daemon() function instead (which does
7 work). this should work the same before and after for all systems.
9 --- a/irattach/util.c
10 +++ b/irattach/util.c
11 @@ -156,21 +156,10 @@
13 void fork_now(int ttyfd)
15 - int ret;
16 int i;
18 - if ((ret = fork()) > 0)
19 - exit(0);
21 - if (ret == -1)
22 - syslog(LOG_INFO, "forking: %m");
23 - if (setsid() < 0)
24 - syslog(LOG_INFO, "detaching from tty: %m");
26 - if ((ret = fork()) > 0) {
27 - /* cleanup_files = 0; */
28 - exit(0);
29 - }
30 + if (daemon(1, 1))
31 + syslog(LOG_INFO, "daemon: %m");
33 /* Close all open inherited files! Except for ttyfd! */
34 for (i = 0; i < 64; i++)