The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / irda-utils / 0001-daemon.patch
1 written by Mike Frysinger
2
3 https://sourceforge.net/tracker/?func=detail&aid=3132053&group_id=5616&atid=305616
4
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.
8
9 --- a/irattach/util.c
10 +++ b/irattach/util.c
11 @@ -156,21 +156,10 @@
12  
13  void fork_now(int ttyfd)
14  {
15 -       int ret;
16         int i;
17  
18 -       if ((ret = fork()) > 0)
19 -               exit(0);
20 -       
21 -       if (ret == -1)
22 -               syslog(LOG_INFO, "forking: %m");
23 -       if (setsid() < 0)
24 -               syslog(LOG_INFO, "detaching from tty: %m");
25 -
26 -       if ((ret = fork()) > 0) {
27 -               /* cleanup_files = 0; */
28 -               exit(0);
29 -       }
30 +       if (daemon(1, 1))
31 +               syslog(LOG_INFO, "daemon: %m");
32  
33         /* Close all open inherited files! Except for ttyfd! */
34         for (i = 0; i < 64; i++)