Skip to content

Commit

Permalink
avoid trying to unlink unix socket
Browse files Browse the repository at this point in the history
  • Loading branch information
israellot committed Oct 3, 2019
1 parent 28480c6 commit 85da3b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2828,10 +2828,13 @@ void closeListeningSockets(int unlink_unix_socket) {
if (server.sofd != -1) close(server.sofd);
if (server.cluster_enabled)
for (j = 0; j < server.cfd_count; j++) close(server.cfd[j]);

#ifndef _WIN32
if (unlink_unix_socket && server.unixsocket) {
serverLog(LL_NOTICE,"Removing the unix socket file.");
unlink(server.unixsocket); /* don't care if this fails */
}
#endif
}

int prepareForShutdown(int flags) {
Expand Down Expand Up @@ -4164,7 +4167,7 @@ int main(int argc, char **argv) {
/* Store the executable path and arguments in a safe place in order
* to be able to restart the server later. */
server.executable = getAbsolutePath(argv[0]);
server.exec_argv = zmalloc(sizeof(char*)*((PORT_ULONG)argc+1)); WIN_PORT_FIX /* cast (PORT_ULONG) */
server.exec_argv = zmalloc(sizeof(char*)*((size_t)argc+1));
server.exec_argv[argc] = NULL;
for (j = 0; j < argc; j++) server.exec_argv[j] = zstrdup(argv[j]);

Expand Down

0 comments on commit 85da3b0

Please sign in to comment.