Bug in Perl script

From: Alexander Panyushkin <vsityz_at_gmail.com>
Date: Fri, 09 Dec 2011 11:48:01 +0200
I have a script that runs command tail with open descriptor.
After 30 seconds, I close descriptor.  But descriptor not closed.
When script is closed tail is present in ps aux.

$log_file = path_to_log;
eval {
    local $SIG{ALRM} = sub { die; };
    alarm (30);
    open (LOG, "tail -F $log_file|") || die "óan`t open logfile 
\"$log_file\"";
    while (<LOG>) {
        ***
    }
    alarm (0);
};
close (LOG);
print ("Ok\n");
exit(0);

This code is good working in FreeBSD 8.2, but in FreeBSD 9.0 not working.

--
Best Regards
Alexander
Received on Fri Dec 09 2011 - 09:11:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:21 UTC