OSDN Git Service
(root)
/
android-x86
/
system-vold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d24e08
)
Use errno correctly.
author
tao.pei
<tao.pei@ck-telecom.com>
Mon, 17 Aug 2015 12:18:49 +0000
(20:18 +0800)
committer
tao.pei
<tao.pei@ck-telecom.com>
Mon, 17 Aug 2015 12:22:17 +0000
(20:22 +0800)
Make sure to check errno prior to doing anything
else that can modify it.
Change-Id: Id81ecc2c3fa07c222ab1e2ef6441331a1eaad635
Loop.cpp
patch
|
blob
|
history
diff --git
a/Loop.cpp
b/Loop.cpp
index
b1e9f6a
..
37ad102
100644
(file)
--- a/
Loop.cpp
+++ b/
Loop.cpp
@@
-103,10
+103,11
@@
int Loop::lookupActive(const char *id, char *buffer, size_t len) {
}
rc = ioctl(fd, LOOP_GET_STATUS64, &li);
- close(fd);
if (rc < 0 && errno == ENXIO) {
+ close(fd);
continue;
}
+ close(fd);
if (rc < 0) {
SLOGE("Unable to get loop status for %s (%s)", filename,