Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2014 06:59:59 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274579 - head/contrib/netbsd-tests/lib/librt
Message-ID:  <201411160659.sAG6xxda006661@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Nov 16 06:59:58 2014
New Revision: 274579
URL: https://svnweb.freebsd.org/changeset/base/274579

Log:
  Call sem_unlink on semaphores before attempting to create them
  
  Due to the lack of uniqueness in the semaphore name, and the fact that the
  tests don't have cleanup routines, an interrupted test can leave a semaphore
  "laying around", causing all subsequent attempts to run the test to fail
  
  I will file a NetBSD PR for this issue soon

Modified:
  head/contrib/netbsd-tests/lib/librt/t_sem.c

Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c
==============================================================================
--- head/contrib/netbsd-tests/lib/librt/t_sem.c	Sun Nov 16 06:35:20 2014	(r274578)
+++ head/contrib/netbsd-tests/lib/librt/t_sem.c	Sun Nov 16 06:59:58 2014	(r274579)
@@ -86,6 +86,9 @@ ATF_TC_BODY(basic, tc)
 	if (sysconf(_SC_SEMAPHORES) == -1)
 		atf_tc_skip("POSIX semaphores not supported");
 
+#ifdef __FreeBSD__
+	sem_unlink("/sem_b");
+#endif
 	sem_b = sem_open("/sem_b", O_CREAT | O_EXCL, 0644, 0);
 	ATF_REQUIRE(sem_b != SEM_FAILED);
 
@@ -127,6 +130,9 @@ ATF_TC_BODY(child, tc)
 	if (sysconf(_SC_SEMAPHORES) == -1)         
 		atf_tc_skip("POSIX semaphores not supported");
 
+#ifdef __FreeBSD__
+	sem_unlink("/sem_a");
+#endif
 	sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0);
 	ATF_REQUIRE(sem_a != SEM_FAILED);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411160659.sAG6xxda006661>