From 801340db7de42af74d10e66a9d5cdd066d410ad2 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 13 Oct 2015 12:13:11 -0400 Subject: [PATCH] Fix: posix_fallocate() returns int > 0 on errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- formats/ctf/ctf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.34.1