[PATCH 1/1] unix.7: correct example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <xypron.glpk@xxxxxx>
---
 man7/unix.7 | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/man7/unix.7 b/man7/unix.7
index 064c12cc6..630a6384a 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -754,13 +754,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);
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux