]> git.pld-linux.org Git - packages/TiMidity++.git/commitdiff
- patch for timidity to properly detach from a terminal when in the daemon mode
authorJacek Konieczny <jajcus@pld-linux.org>
Wed, 15 Sep 2004 17:08:19 +0000 (17:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    TiMidity++-detach.patch -> 1.1

TiMidity++-detach.patch [new file with mode: 0644]

diff --git a/TiMidity++-detach.patch b/TiMidity++-detach.patch
new file mode 100644 (file)
index 0000000..a4dda6a
--- /dev/null
@@ -0,0 +1,23 @@
+diff -dur TiMidity++-2.13.0.orig/interface/alsaseq_c.c TiMidity++-2.13.0/interface/alsaseq_c.c
+--- TiMidity++-2.13.0.orig/interface/alsaseq_c.c       2004-03-04 05:11:50.000000000 +0100
++++ TiMidity++-2.13.0/interface/alsaseq_c.c    2004-09-15 18:42:41.549524231 +0200
+@@ -402,7 +402,11 @@
+       if (ctl.flags & CTLF_DAEMONIZE)
+       {
+               int pid = fork();
++              int fd;
+               FILE *pidf;
++              for(fd=0;fd<256;fd++){
++                      if (isatty(fd)) close(fd);
++              }
+               switch (pid)
+               {
+                       case 0:                 // child is the daemon
+@@ -414,6 +418,7 @@
+                                       fprintf( pidf, "%d\n", pid );
+                               exit(0);
+               }
++              setsid();
+       }
+       for (;;) {
This page took 0.068078 seconds and 4 git commands to generate.