-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Ralf Wildenhues on 7/7/2009 11:27 PM: >> - . "$at_test_source" # AT_JOB_FIFO_FD<&- >> + . "$at_test_source" # AT_JOB_FIFO_FD>&- > > This hunk is actually wrong, and I don't remember seeing it in the > first iteration of your patch. Of course, since it only changes a > comment, it is not relevant. However, you cannot close the fd for > writing here, because a PIPE signal (that could happen within a test > group for completely unrelated reasons) will cause the process to try > to use it. It's only the reading end that would be unused here (but > of course the notation would close the fd for either use).
I agree that since it is in a comment, it makes no effect to the overall testsuite, but I'm not quite sure that it is wrong. POSIX allows either n<&- or n>&- to close an fd, and requires that closing an fd be silent if the fd is not open. In other words, using <&- to close a write fd or >&- to close a read fd is not wrong, just confusing when reading. At any rate, this line of code occurs inside the child subshell, where we have already exec'd the fifo open for writes (and thus there is NO fd open for reads), so if we were to uncomment this line, it makes more sense to use the >&- notation than <&- to close the fd for consistency with the fact that we know the fd would be open for writes at this point in the subshell. > I think it's best to remove the comment, or change the trap to output > to $at_job_fifo rather than the fd. I haven't tried that, though. OK, I see your point - if we were to uncomment that line, then the trap should still be guaranteed that the fd is open or else write directly to the fifo rather than to the fd. - -- Don't work too hard, make some time for fun as well! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpUk80ACgkQ84KuGfSFAYBoTACfY7zs1tNSK1+BxFzM9I9TuYuK CgMAn2hoHDKfKhqA3n08ZF9CohJ4JmtQ =0BJh -----END PGP SIGNATURE-----
