projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf2dd8d
)
Fix fd leak in cache line checking
author
Jens Axboe
<jens.axboe@oracle.com>
Tue, 9 Jun 2009 11:05:32 +0000
(13:05 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Tue, 9 Jun 2009 11:05:32 +0000
(13:05 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
os/os-linux.h
patch
|
blob
|
blame
|
history
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