summaryrefslogtreecommitdiff
path: root/sysfs.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 17:26:12 +1000
committerNeilBrown <neilb@suse.de>2011-07-27 17:26:12 +1000
commit6560987b25a88f78ed53d37525d363c126a07b79 (patch)
treec75a1faafac1760242e49852211f9596f0fc4d5c /sysfs.c
parent656b6b5a55adb1fd223d82478c333264af52877a (diff)
Grow: ensure clean abort if we cannot read the 'completed' file.
If a read of 'completed' returns an error, select will never fail, so this loop would never exit. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysfs.c b/sysfs.c
index 44314baf..56813b7d 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -470,7 +470,7 @@ int sysfs_fd_get_ll(int fd, unsigned long long *val)
lseek(fd, 0, 0);
n = read(fd, buf, sizeof(buf));
if (n <= 0)
- return -1;
+ return -2;
buf[n] = 0;
*val = strtoull(buf, &ep, 0);
if (ep == buf || (*ep != 0 && *ep != '\n' && *ep != ' '))