mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Fixed use of deprecated tempnam
This commit is contained in:
parent
1a7a44998b
commit
840feef1c3
@ -123,10 +123,11 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
|
|||||||
std::string addr (addr_);
|
std::string addr (addr_);
|
||||||
|
|
||||||
// Allow wildcard file
|
// Allow wildcard file
|
||||||
if (addr[0] == '*') {
|
if (addr [0] == '*') {
|
||||||
char *tmpstr = tempnam (NULL, NULL);
|
char buffer [12] = "2134XXXXXX";
|
||||||
addr.assign (tmpstr);
|
if (mkstemp (buffer) == -1)
|
||||||
free (tmpstr);
|
return -1;
|
||||||
|
addr.assign (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get rid of the file associated with the UNIX domain socket that
|
// Get rid of the file associated with the UNIX domain socket that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user