Thread (1 message) 1 message, 1 author, 2011-01-27

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

From: Peter Korsgaard <jacmet@sunsite.dk>
Date: 2011-01-27 11:29:52

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
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help