Close stream and channel file descriptors as soon as passed to sessiond
[lttng-ust.git] / libringbuffer / shm.c
index 994204d1e0a2463829a8e73e3cb0cf078eae1c0f..69e4b1a765eb1d9dea37b9cafb6c06bbf8f4e8ad 100644 (file)
@@ -211,10 +211,12 @@ void shmp_object_destroy(struct shm_object *obj)
                        assert(0);
                }
        }
-       ret = close(obj->shm_fd);
-       if (ret) {
-               PERROR("close");
-               assert(0);
+       if (obj->shm_fd >= 0) {
+               ret = close(obj->shm_fd);
+               if (ret) {
+                       PERROR("close");
+                       assert(0);
+               }
        }
        for (i = 0; i < 2; i++) {
                if (obj->wait_fd[i] < 0)
This page took 0.023227 seconds and 4 git commands to generate.