From: Jérémie Galarneau Date: Thu, 19 May 2016 22:24:20 +0000 (-0400) Subject: Fix: don't negate posix_fadvise return value to check error X-Git-Tag: v2.9.0-rc1~153 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a74a5f4a84e873edb42c8c0221064147912befd9;p=lttng-tools.git Fix: don't negate posix_fadvise return value to check error Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 7ce294e81..6773fbae8 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1266,8 +1266,8 @@ void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream, ret = posix_fadvise(outfd, orig_offset - stream->max_sb_size, stream->max_sb_size, POSIX_FADV_DONTNEED); if (ret && ret != -ENOSYS) { - errno = -ret; - PERROR("posix_fadvise"); + errno = ret; + PERROR("posix_fadvise on fd %i", outfd); } }