- my $pid = fork();
- if (defined $pid) {
- if (!$pid) {
- # in child, unset warnings, disable debugging and general clean up from us
- $^W = 0;
- eval "{ package DB; sub DB {} }";
- DXChannel::closeall();
- for (@main::listeners) {
- $_->close_server;
- }
- unless ($^O =~ /^MS/) {
- $SIG{HUP} = 'IGNORE';
- $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
- alarm(0);
- }
- exec "$line" or dbg('cron', "exec '$line' failed $!");
- }
- dbg('connect', "program $sort $line started");
- $conn->{pid} = $pid;
+ my $sock = new IO::Socket::INET;
+ local *H;
+ my $wrt = \*H;
+
+ if ($conn->{pid} = open3("<&$sock", ">&$sock", '', $line)) {
+ $conn->{sock} = $sock;