projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix fd leak in cache line checking
[fio.git]
/
os
/
os-linux.h
diff --git
a/os/os-linux.h
b/os/os-linux.h
index 1cd8272d5241750c67107536b2a0a1268236e7c0..b766cbf9503af73a144e5cddf1f542ed8e13e3b4 100644
(file)
--- a/
os/os-linux.h
+++ b/
os/os-linux.h
@@
-263,10
+263,13
@@
static inline int arch_cache_line_size(void)
return -1;
ret = read(fd, size, sizeof(size));
+
+ close(fd);
+
if (ret <= 0)
return -1;
-
- return atoi(size);
+ else
+
return atoi(size);
}
#endif