ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-Watchdog/Watchdog.pm
(Generate patch)

Comparing AnyEvent-Watchdog/Watchdog.pm (file contents):
Revision 1.3 by root, Thu Aug 13 22:56:11 2009 UTC vs.
Revision 1.5 by root, Fri Aug 14 23:08:54 2009 UTC

53# load modules we will use later anyways 53# load modules we will use later anyways
54use common::sense; 54use common::sense;
55 55
56use Carp (); 56use Carp ();
57 57
58our $VERSION = '0.1'; 58our $VERSION = '0.9';
59 59
60our $PID; # child pid 60our $PID; # child pid
61our $ENABLED = 1; 61our $ENABLED = 1;
62our $AUTORESTART; # actually exit 62our $AUTORESTART; # actually exit
63our $HEARTBEAT; 63our $HEARTBEAT;
164 164
165our %SEEKPOS; 165our %SEEKPOS;
166# due to bugs in perl, try to remember file offsets for all fds, and restore them later 166# due to bugs in perl, try to remember file offsets for all fds, and restore them later
167# (the parser otherwise exhausts the input files) 167# (the parser otherwise exhausts the input files)
168 168
169# this causes perlio to flush it's handles internally, so 169# this causes perlio to flush its handles internally, so
170# seek offsets become correct. 170# seek offsets become correct.
171exec "."; # toi toi toi 171exec "."; # toi toi toi
172#{ 172#{
173# local $SIG{CHLD} = 'DEFAULT'; 173# local $SIG{CHLD} = 'DEFAULT';
174# my $pid = fork; 174# my $pid = fork;
178# } else { 178# } else {
179# kill 9, $$; 179# kill 9, $$;
180# } 180# }
181#} 181#}
182 182
183# now records all fd positions 183# now record "all" fd positions, assuming 1023 is more than enough.
184for (0 .. 1023) { 184for (0 .. 1023) {
185 open my $fh, "<&$_" or next; 185 open my $fh, "<&$_" or next;
186 $SEEKPOS{$_} = (sysseek $fh, 0, 1 or next); 186 $SEEKPOS{$_} = (sysseek $fh, 0, 1 or next);
187} 187}
188 188

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines