Fix possible error on close
authorDavid Goulet <david.goulet@polymtl.ca>
Mon, 27 Jun 2011 20:36:22 +0000 (16:36 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Mon, 27 Jun 2011 20:36:22 +0000 (16:36 -0400)
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
ltt-sessiond/trace.c

index 40ba95136713e492d9c49aab05c000b6a23d699a..e0051cd1cabe0e7d50bd783c4b4a48d67429e925 100644 (file)
@@ -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);
 
This page took 0.033321 seconds and 4 git commands to generate.