From: Mathieu Desnoyers Date: Fri, 2 Mar 2012 16:12:26 +0000 (-0500) Subject: Fix: sessiond has incorrect missing 0 value in FD check X-Git-Tag: v2.0.0-rc2~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5a47c6a2b20bd88bdb629e159009238248f10ba1;p=lttng-tools.git Fix: sessiond has incorrect missing 0 value in FD check When run with daemon(), the 0 file descriptor can be re-used for something else than stdout. Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 8e960dfed..371ee4f98 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -483,7 +483,7 @@ int kernel_open_channel_stream(struct ltt_kernel_channel *channel) int ret; struct ltt_kernel_stream *lks; - while ((ret = kernctl_create_stream(channel->fd)) > 0) { + while ((ret = kernctl_create_stream(channel->fd)) >= 0) { lks = trace_kernel_create_stream(); if (lks == NULL) { close(ret);