From: Jérémie Galarneau Date: Wed, 18 May 2016 20:05:19 +0000 (-0400) Subject: Fix: posix_fadvise wrapper returns -ENOSYS on FreeBSD X-Git-Tag: v2.9.0-rc1~181 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a0d0e12718becc1ecc4b6cc8e553522eeb72e058;p=lttng-tools.git Fix: posix_fadvise wrapper returns -ENOSYS on FreeBSD Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 321703a51..8b8e74c33 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1265,8 +1265,9 @@ 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) { - WARN("posix_fadvise() error (%i)", ret); + if (ret && ret != -ENOSYS) { + errno = -ret; + PERROR("posix_fadvise"); } }