From 18bbb297ebc0dbfe15d80b86d14c348e31ca06d6 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 27 Jun 2018 03:09:05 +0200 Subject: [PATCH] unix.7: Correct example The example is misleading. It is not a good idea to unlink an existing socket because we might try to start the server multiple times. In this case it is preferable to receive an error. We could add code that removes the socket when the server process is killed but that would stretch the example too far. Signed-off-by: Heinrich Schuchardt Signed-off-by: Michael Kerrisk --- man7/unix.7 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/man7/unix.7 b/man7/unix.7 index 474b4a7aa..60d633c9c 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -934,13 +934,6 @@ main(int argc, char *argv[]) int result; char buffer[BUFFER_SIZE]; - /* - * In case the program exited inadvertently on the last run, - * remove the socket. - */ - - unlink(SOCKET_NAME); - /* Create local socket. */ connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);