X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libringbuffer%2Fshm.c;h=69e4b1a765eb1d9dea37b9cafb6c06bbf8f4e8ad;hb=51920067af7b1049413c1b8c30ee254afbd4e448;hp=994204d1e0a2463829a8e73e3cb0cf078eae1c0f;hpb=35897f8b2d311b756b81657dad9c53ef1c0fad8a;p=lttng-ust.git diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 994204d1..69e4b1a7 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -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)