Re: Clean up sha1 file writing
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jun 4, 2006, 18:40 UTC
- Message-ID
- <Pine.LNX.4.64.0606041139310.5498@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.64.0606041136180.5498@g5.osdl.org>
On Sun, 4 Jun 2006, Linus Torvalds wrote:
Show 10 quoted lines
> > On Sun, 4 Jun 2006, H. Peter Anvin wrote: > > > > Or if you're getting a SIGWINCH in the middle of it. > > > > Any POSIX system will interrupt the transfer and return a short read on > > receiving a signal. > > Only for interruptible fd's, though, which normally a real "file" won't > be.
And _usually_ only if you actually have a SIGWINCH handler.
Although older Linux kernels were broken in this regard. They'd interrupt a socket/pipe read or write even for a signal that ended up being ignored.
So it's absolutely the case that having the loop is always the safer thing to do, and it's never the _wrong_ thing to do.
Linus