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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "Baruch" == Baruch Siach <baruch@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux