projects
/
lttng-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
994ab36
)
Fix: write index only if fd is valid
author
David Goulet
<dgoulet@efficios.com>
Tue, 11 Feb 2014 19:13:01 +0000
(14:13 -0500)
committer
David Goulet
<dgoulet@efficios.com>
Tue, 11 Feb 2014 19:13:01 +0000
(14:13 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/index/index.c
patch
|
blob
|
blame
|
history
diff --git
a/src/common/index/index.c
b/src/common/index/index.c
index 54689677ee4a2f3dd3c56a6f06236115f659ead6..58918caaa7dc6dfd790c15d9ced857ad2ecf7c4e 100644
(file)
--- a/
src/common/index/index.c
+++ b/
src/common/index/index.c
@@
-100,14
+100,19
@@
ssize_t index_write(int fd, struct ctf_packet_index *index, size_t len)
{
ssize_t ret;
- assert(fd >= 0);
assert(index);
+ if (fd < 0) {
+ ret = -EINVAL;
+ goto error;
+ }
+
ret = lttng_write(fd, index, len);
if (ret < len) {
PERROR("writing index file");
}
+error:
return ret;
}
This page took
0.025568 seconds
and
4
git commands to generate.