diff options
author | Peter Palfrader <peter@palfrader.org> | 2002-09-08 18:17:31 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2002-09-08 18:17:31 +0000 |
commit | 5fdf1824aed4ce53742e9d37dd39d3e0c5e8c33a (patch) | |
tree | 7424473a2fa5dc45a2063b2f07e6a33a65956d1a /pingd | |
parent | 686dae936b387c672b54cb568c28e6e792a81364 (diff) |
Reopen stdin to /dev/null instead of closing it to avoid perl 5.8 warnings
Diffstat (limited to 'pingd')
-rwxr-xr-x | pingd | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3,7 +3,7 @@ $| = 1; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: pingd,v 1.72 2002/09/05 15:12:42 weasel Exp $ +# $Id: pingd,v 1.73 2002/09/08 18:17:31 weasel Exp $ # =pod @@ -287,7 +287,7 @@ use POSIX qw(setsid); delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; -my $VERSION = '2.0rc1'; +my $VERSION = '2.0rc2'; my $redirected_stdio = 0; @@ -630,11 +630,9 @@ if ($COMMAND eq 'add' || $COMMAND eq 'delete') { exit(0) if (fork()); POSIX::setsid(); exit(0) if (fork()); - close STDOUT; - close STDERR; open (STDOUT, ">>output") or die ("Cannot open 'output' as STDOUT\n"); open (STDERR, ">&STDOUT") or die ("Cannot dup STDOUT as STDERR\n"); - close STDIN; + open (STDIN , "</dev/null") or die ("Cannot open /dev/null as STDIN\n"); $redirected_stdio = 1; print "Startup at ".scalar localtime().".\n"; daemon_run( $params->{'process'} ); |