Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Dec 2011 11:48:01 +0200
From:      Alexander Panyushkin <vsityz@gmail.com>
To:        freebsd-current@freebsd.org.
Subject:   Bug in Perl script
Message-ID:  <4EE1D951.2030509@gmail.com>

next in thread | raw e-mail | index | archive | help
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 =3D path_to_log;
eval {
    local $SIG{ALRM} =3D sub { die; };
    alarm (30);
    open (LOG, "tail -F $log_file|") || die "=F3an`t open logfile=20
\"$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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EE1D951.2030509>