[Bug:trunk] trap(:USR1, "EXIT") doesn't in effect when sysread is interputted


#1

e$B0J2<$N%W%m%0%i%`$N$h$&$K!“e(Btrap e$B$Ge(B USR1 e$B$Ke(B EXIT
e$B$H@_Dj$7$F$”$Ce(B
e$B$?;~!"e(BSIGUSR1 e$B$G3d$j9~$^$l$?;~$Ke(B EINTR
e$B$K$J$C$F$7$^$$$^$9!#e(B

% ./ruby -ve ’
r,w = IO.pipe
pid = fork {
trap(:USR1, “EXIT”)
r.sysread(4096)
}
sleep 1
Process.kill(:USR1, pid)
Process.wait(pid)

ruby 1.9.1 (2008-12-29 patchlevel-5000 trunk 21182) [i686-linux]
-e:5:in sysread': Interrupted system call (Errno::EINTR) from -e:5:inblock in ’
from -e:3:in fork' from -e:3:in

1.8 e$B$G$O!"e(BEXIT e$B$N;XDj$I$*$j!“e(BEINTR
e$B$K$J$k$3$H$J$/!”=*N;$7$^$9!#e(B

% ruby-1.8 -ve ’
r,w = IO.pipe
pid = fork {
trap(:USR1, “EXIT”)
r.sysread(4096)
}
sleep 1
Process.kill(:USR1, pid)
Process.wait(pid)

ruby 1.8.7 (2008-12-26 revision 21066) [i686-linux]