User: Password:
|
|
Subscribe / Log in / New account

code feedback ...

code feedback ...

Posted Sep 13, 2011 6:08 UTC (Tue) by jzbiciak (subscriber, #5246)
In reply to: code feedback ... by jzbiciak
Parent article: Ensuring data reaches disk

Err... I guess the read error path returns -1 or 0, which again I think may be an error, unless you wanted to return 0 when the connection drops before "nrbytes" gets read. Oops.

That raises a different question: If you exit early due to the socket dropping, you won't fflush/fsync. Seems like you want a 'break' if read returned 0 and errno != EINTR, don't you?


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds