Skip to content

Commit 760a024

Browse files
committed
Fix Windows unlink warning
1 parent 89ad4cb commit 760a024

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bsd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,11 @@ LIBUS_SOCKET_DESCRIPTOR bsd_create_listen_socket_unix(const char *path, int opti
533533
server_address.sun_family = AF_UNIX;
534534
strcpy(server_address.sun_path, path);
535535
int size = offsetof(struct sockaddr_un, sun_path) + strlen(server_address.sun_path);
536+
#ifdef _WIN32
537+
_unlink(path);
538+
#else
536539
unlink(path);
540+
#endif
537541

538542
if (bind(listenFd, (struct sockaddr *)&server_address, size) || listen(listenFd, 512)) {
539543
bsd_close_socket(listenFd);

0 commit comments

Comments
 (0)