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

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.240 by root, Fri Jul 17 14:57:03 2009 UTC vs.
Revision 1.241 by root, Fri Jul 17 18:08:35 2009 UTC

1184# allow only one watcher per fd, so we dup it to get a different one). 1184# allow only one watcher per fd, so we dup it to get a different one).
1185sub _dupfh($$;$$) { 1185sub _dupfh($$;$$) {
1186 my ($poll, $fh, $r, $w) = @_; 1186 my ($poll, $fh, $r, $w) = @_;
1187 1187
1188 # cygwin requires the fh mode to be matching, unix doesn't 1188 # cygwin requires the fh mode to be matching, unix doesn't
1189 my ($rw, $mode) = $poll eq "r" ? ($r, "<") : ($w, ">"); 1189 my ($rw, $mode) = $poll eq "r" ? ($r, "<&") : ($w, ">&");
1190 1190
1191 open my $fh2, "$mode&", $fh 1191 open my $fh2, $mode, $fh
1192 or die "AnyEvent->io: cannot dup() filehandle in mode '$poll': $!,"; 1192 or die "AnyEvent->io: cannot dup() filehandle in mode '$poll': $!,";
1193 1193
1194 # we assume CLOEXEC is already set by perl in all important cases 1194 # we assume CLOEXEC is already set by perl in all important cases
1195 1195
1196 ($fh2, $rw) 1196 ($fh2, $rw)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines