X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Firda-utils%2F0001-daemon.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Firda-utils%2F0001-daemon.patch;h=f6034a75b446473e28636d3499c41f06db2713df;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/irda-utils/0001-daemon.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/irda-utils/0001-daemon.patch new file mode 100644 index 0000000..f6034a7 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/irda-utils/0001-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++)