summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2011-06-05 14:11:09 +0200
committerMatthieu Herrb <matthieu.herrb@laas.fr>2011-06-05 14:11:09 +0200
commitc53510fcc9eb857ec7ccf399f69c9b993993eae6 (patch)
treec46defc2801502364359a47c05175f22e5cf9ab6
parenta9c2bd419ba43b9f14bda884b38fed4baa2bced2 (diff)
parentf9159b97834ba4b4e42a07953a33866e7ac90dbd (diff)
Merge remote-tracking branch 'origin/master' into obsd
-rw-r--r--src/linux_sysfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 1832ee7..bbd4dfa 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -387,7 +387,9 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data,
/* If zero bytes were read, then we assume it's the end of the
* config file.
*/
- if ( bytes <= 0 ) {
+ if (bytes == 0)
+ break;
+ if ( bytes < 0 ) {
err = errno;
break;
}
@@ -445,7 +447,9 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data,
/* If zero bytes were written, then we assume it's the end of the
* config file.
*/
- if ( bytes <= 0 ) {
+ if ( bytes == 0 )
+ break;
+ if ( bytes < 0 ) {
err = errno;
break;
}