Problem: close always fails with wildcard bind, since directory is not empty

Solution: unlink the socket file first
This commit is contained in:
Simon Giesecke
2019-02-04 05:33:28 -05:00
parent b14bb2d8f8
commit 8d784f26ab
4 changed files with 34 additions and 22 deletions

View File

@@ -44,20 +44,8 @@ void tearDown ()
void test_rebind_ipc ()
{
char my_endpoint[32], random_file[16];
strcpy (random_file, "tmpXXXXXX");
#ifdef HAVE_MKDTEMP
TEST_ASSERT_TRUE (mkdtemp (random_file));
strcat (random_file, "/ipc");
#else
int fd = mkstemp (random_file);
TEST_ASSERT_TRUE (fd != -1);
close (fd);
#endif
strcpy (my_endpoint, "ipc://");
strcat (my_endpoint, random_file);
char my_endpoint[32];
make_random_ipc_endpoint (my_endpoint);
void *sb0 = test_context_socket (ZMQ_PUSH);
void *sb1 = test_context_socket (ZMQ_PUSH);