commit 289e29826cf1ce827e69ad3b6af8d2d9933bc875
Author: Elan Ruusamäe <[email protected]>
Date:   Sun Mar 2 02:40:52 2014 +0200

    daemon: always close stdin, avoids weird program deaths; redirect stdin 
"in", not "out"

 lib/functions | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/functions b/lib/functions
index 56cab80..e75f61d 100644
--- a/lib/functions
+++ b/lib/functions
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/289e29826cf1ce827e69ad3b6af8d2d9933bc875

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to