diff options
author | Yuriy Nazarov | 2014-06-19 01:12:22 +0200 |
---|---|---|
committer | Yuriy Nazarov | 2014-06-19 01:12:22 +0200 |
commit | f0fe8ab50df992e2f0a9e8c49b2c43d161880d07 (patch) | |
tree | 4ba44ed0db83b1702e3581dc1659c6cb4c0dfb15 | |
parent | build-sys: add libsmartcols to ko-release-gen script (diff) | |
download | kernel-qcow2-util-linux-f0fe8ab50df992e2f0a9e8c49b2c43d161880d07.tar.gz kernel-qcow2-util-linux-f0fe8ab50df992e2f0a9e8c49b2c43d161880d07.tar.xz kernel-qcow2-util-linux-f0fe8ab50df992e2f0a9e8c49b2c43d161880d07.zip |
lib/loopdev.c: reset errno before strtol() call
Fixed unsuccessful attempt to find unused loop devices if 0-7
devices already used and /dev/loop directory exists.
-rw-r--r-- | lib/loopdev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c index 988f3d337..2488a6fdb 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -458,6 +458,7 @@ static int loop_scandir(const char *dirname, int **ary, int hasprefix) /* /dev/loop/<N> */ char *end = NULL; + errno = 0; n = strtol(d->d_name, &end, 10); if (d->d_name == end || (end && *end) || errno) continue; |