projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
t/btrace2fio: fix fd leak on error
[fio.git]
/
t
/
btrace2fio.c
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;
}