Unlink file after binding to it.

When unlinking the file before binding, a new entry is created
in the file system after binding. This is not desireable, so
unlink it after binding to remove the temporary file after the process
closes.
This commit is contained in:
Armin Novak 2017-09-25 10:35:24 +02:00
parent 4592deee72
commit 884e87fde4

View File

@ -185,9 +185,9 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char*
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, path, sizeof(addr.sun_path));
unlink(path);
status = _bind(sockfd, (struct sockaddr*) &addr, sizeof(addr));
unlink(path);
if (status != 0)
{