From: Alexander Monakov Date: Thu, 11 Sep 2014 15:33:36 +0000 (+0200) Subject: fix shm subtest in cancellation points test X-Git-Url: http://nsz.repo.hu/git/?p=libc-test;a=commitdiff_plain;h=a25bb2cc3dc78e33d5ec251606b090f48d15b476 fix shm subtest in cancellation points test --- diff --git a/src/functional/pthread_cancel-points.c b/src/functional/pthread_cancel-points.c index 4cb50d2..eb7dac7 100644 --- a/src/functional/pthread_cancel-points.c +++ b/src/functional/pthread_cancel-points.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "test.h" #define TESTC(c, m) ( (c) || (t_error(#c " failed (%s, " m ")\n", cdescr), 0) ) @@ -85,9 +86,10 @@ static void execute_shm_open(void *arg) static void cleanup_shm(void *arg) { int *fd = arg; - if (*fd != -1) + if (*fd > 0) { TESTE(close(*fd), "shm fd"); - TESTE(shm_unlink("/testshm"), ""); + TESTE(shm_unlink("/testshm"), ""); + } } static struct {