From: Michael Jeanson Date: Tue, 13 Oct 2015 16:13:11 +0000 (-0400) Subject: Fix: posix_fallocate() returns int > 0 on errors X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=34b69bb69b18f70cf3f3c38a8d36eaae07725e54 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 74fcb5bc..19f61b58 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -906,7 +906,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: