* Re: [PATCH 1/1] unix.7: correct example
[not found] <20180627010905.8959-1-xypron.glpk@gmx.de>
@ 2020-04-06 11:56 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; only message in thread
From: Michael Kerrisk (man-pages) @ 2020-04-06 11:56 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: mtk.manpages, linux-man
Hello Heinrich,
On 6/27/18 3:09 AM, Heinrich Schuchardt wrote:
> 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@gmx.de>
Thanks. Patch applied.
Cheers,
Michael
> ---
> 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);
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-06 11:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20180627010905.8959-1-xypron.glpk@gmx.de>
2020-04-06 11:56 ` [PATCH 1/1] unix.7: correct example Michael Kerrisk (man-pages)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.