projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
356c552
)
t/btrace2fio: fix fd leak on error
author
Jens Axboe
<axboe@fb.com>
Wed, 15 Oct 2014 01:55:18 +0000
(19:55 -0600)
committer
Jens Axboe
<axboe@fb.com>
Wed, 15 Oct 2014 01:55:18 +0000
(19:55 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
t/btrace2fio.c
patch
|
blob
|
blame
|
history
diff --git
a/t/btrace2fio.c
b/t/btrace2fio.c
index 5666a560c0beca15941ad596a3469a4422264d36..baf29acb9d41a9434ec028f8212f8842f6ff7972 100644
(file)
--- a/
t/btrace2fio.c
+++ b/
t/btrace2fio.c
@@
-870,9
+870,11
@@
static int trace_needs_swap(const char *trace_file, int *swap)
ret = read(fd, &t, sizeof(t));
if (ret < 0) {
+ close(fd);
perror("read");
return 1;
} else if (ret != sizeof(t)) {
+ close(fd);
log_err("fio: short read on trace file\n");
return 1;
}