Re: [PATCHv2] evdev: fix evdev_write return value on partial writes

Started by Peter Korsgaard on Jan 27, 2011

open the first message on its own page

Message details and related content
quoted
quoted
quoted
quoted
"Baruch" == Baruch Siach [off-list ref] writes:
 >> wlile (len) {
 >> n = write(fd, buf, len);
 >> if (n <= 0) break;
 >> len -= n;
 >> buf += n;
 >> }
 >> 
 >> Which will then loop forever.

 Baruch> Well this code won't loop forever, since n == 0. Only if you do:

 Baruch>     if (n < 0) break;

 Baruch> That is.

Naturally, -ENOCOFFE.

-- 
Bye, Peter Korsgaard
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help