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.7.3~30 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e8776cb38d084f1051da19363be650284f280897;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.c b/src/common/consumer.c index a96d5165e..558112271 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1266,8 +1266,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"); } }