From: David Goulet Date: Mon, 27 Jun 2011 20:36:22 +0000 (-0400) Subject: Fix possible error on close X-Git-Tag: v2.0-pre1~76 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=70dc1c3472b32f9f438ae6fdacbc9e656beecbe1;p=lttng-tools.git Fix possible error on close Signed-off-by: David Goulet --- diff --git a/ltt-sessiond/trace.c b/ltt-sessiond/trace.c index 40ba95136..e0051cd1c 100644 --- a/ltt-sessiond/trace.c +++ b/ltt-sessiond/trace.c @@ -297,8 +297,10 @@ void trace_destroy_kernel_session(struct ltt_kernel_session *session) DBG("[trace] Closing session fd %d", session->fd); /* Close kernel fds */ close(session->fd); - DBG("[trace] Closing metadata stream fd %d", session->metadata_stream_fd); - close(session->metadata_stream_fd); + if (session->metadata_stream_fd != 0) { + DBG("[trace] Closing metadata stream fd %d", session->metadata_stream_fd); + close(session->metadata_stream_fd); + } trace_destroy_kernel_metadata(session->metadata);