]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
daemon: always close stdin, avoids weird program deaths; redirect stdin "in", not...
authorElan Ruusamäe <glen@delfi.ee>
Sun, 2 Mar 2014 00:40:52 +0000 (02:40 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 2 Mar 2014 00:40:52 +0000 (02:40 +0200)
lib/functions

index 56cab8051812f76851c20bf7fd4e7767a7ba5ba5..e75f61d25bc98c50ac03ba341698848bd966452f 100644 (file)
@@ -726,13 +726,14 @@ daemon() {
                if [ "$closefds" = 1 ]; then
                        exec 1>&-
                        exec 2>&-
-                       exec 0>&-
+                       exec 0<&-
                elif [ "$redirfds" = 1 ]; then
                        exec 1>/dev/null
                        exec 2>/dev/null
-                       exec 0>/dev/null
+                       exec 0</dev/null
                else
                        exec 2>&1
+                       exec 0</dev/null
                fi
 
                if is_no "$RC_LOGGING"; then
This page took 0.215113 seconds and 4 git commands to generate.