Fixed wildcard IPC endpoint and added test case

This commit is contained in:
Pieter Hintjens
2013-12-20 14:28:54 +01:00
parent 62f3fdf3b7
commit bf3702395c
4 changed files with 62 additions and 1 deletions

View File

@@ -133,9 +133,11 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
// Allow wildcard file
if (addr [0] == '*') {
char buffer [12] = "2134XXXXXX";
if (mkstemp (buffer) == -1)
int fd = mkstemp (buffer);
if (fd == -1)
return -1;
addr.assign (buffer);
::close (fd);
}
// Get rid of the file associated with the UNIX domain socket that