[Fwd: Re: [Fwd: Re: Last item on TODO list for mc before 4.6.1]]
Roland Illig
roland.illig at gmx.de
Fri Sep 24 09:04:07 UTC 2004
Leonard den Ottolander wrote:
> Hm. pipethrough "ls" gives me "Broken pipe" :p .
Here's a patch. According to both the Linux documentation and
POSIX-1003.1-2001 the write() call returns EPIPE when SIGPIPE is
ignored, so this time there should be an output of ("write: " +
strerror(EPIPE)).
I couldn't reproduce it on my system, but the cause might be that "ls"
is too fast and the writing is not atomical. So here is what might happen:
parent: select(...) [returns: you can write to "ls"]
child: execl("/bin/sh", "/bin/sh", "-c", "ls", NULL);
child: ...
child: _exit(0);
parent: write(ls's stdin, "hello, world", 13)
Roland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pipethrough-sigpipe.patch
Type: text/x-patch
Size: 990 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20040924/72fd0781/attachment.bin>
More information about the mc-devel
mailing list