From: Michael Jeanson Date: Tue, 13 Oct 2015 16:13:11 +0000 (-0400) Subject: Fix: posix_fallocate() returns int > 0 on errors X-Git-Tag: v1.3.0~35 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=801340db7de42af74d10e66a9d5cdd066d410ad2 Fix: posix_fallocate() returns int > 0 on errors Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 29fa5984..a32e0cc0 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -908,7 +908,7 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) pos->packet_size = WRITE_PACKET_LEN; off = posix_fallocate(pos->fd, pos->mmap_offset, pos->packet_size / CHAR_BIT); - assert(off >= 0); + assert(off == 0); pos->offset = 0; } else { read_next_packet: