]> ruderich.org/simon Gitweb - fcscs/fcscs.git/blobdiff - bin/fcscs
run_in_background: redirect to /dev/null instead of using close
[fcscs/fcscs.git] / bin / fcscs
index c44b8eaeb623c53846ee2b8f8c22931acc56e17f..35e50e3a4fe7891e9018df4edb30ab20ca7527cb 100755 (executable)
--- a/bin/fcscs
+++ b/bin/fcscs
@@ -502,9 +502,11 @@ sub run_in_background {
 
         # Necessary for GNU screen or it'll keep the window open until an
         # external command has run.
-        close STDIN  or die $!;
-        close STDOUT or die $!;
-        close STDERR or die $!;
+        require File::Spec;
+        my $devnull = File::Spec->devnull();
+        open STDIN,  '<', $devnull or die $!;
+        open STDOUT, '>', $devnull or die $!;
+        open STDERR, '>', $devnull or die $!;
 
         # Double-fork to prevent zombies.
         my $pid = fork;