public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: "Lili Püspök" <poordirtylili@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: patch - fixing sample program in unix.7
Date: Mon, 4 Mar 2024 17:21:56 +0100	[thread overview]
Message-ID: <ZeX1JTt2Sxot-JFU@debian> (raw)
In-Reply-To: <CALPhBBbmrAMR70WT-JfKoSQVLhfxKv5B68Gyo_4zZRY-7SS0-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1719 bytes --]

Hi Lili,

> Subject: Re: patch - fixing sample program in unix.7

On Sun, Mar 03, 2024 at 08:27:17PM +0100, Lili Püspök wrote:
> diff --git a/man7/unix.7 b/man7/unix.7

Please add some commit message.  I don't understand what this patch
does.  How is it broken, and how does it fix it?

> index cb1dcae45..7fb41af99 100644
> --- a/man7/unix.7
> +++ b/man7/unix.7
> @@ -1057,7 +1057,7 @@ main(int argc, char *argv[])
> \&
>             if (!strncmp(buffer, "DOWN", sizeof(buffer))) {
>                 down_flag = 1;
> -                break;
> +                continue;

DOWN is used to stop the server.  How would 'continue' help?


	$ MANWIDTH=66 man unix | grep -C2 DOWN
	     tegers.  The client prints the sum and exits.   The  server
	     waits  for the next client to connect.  To stop the server,
	     the client is called with the command‐line argument "DOWN".

	     The following output was recorded while running the  server
	     in the background and repeatedly executing the client.  Ex‐
	     ecution  of  the  server  program ends when it receives the
	     "DOWN" command.

	   Example output
	--
		 $ ./client 11 -5
		 Result = 6
		 $ ./client DOWN
		 Result = 0
		 [1]+  Done                    ./server
	--
			 /* Handle commands. */

			 if (!strncmp(buffer, "DOWN", sizeof(buffer))) {
			     down_flag = 1;
			     break;
	--
		     close(data_socket);

		     /* Quit on DOWN command. */

		     if (down_flag) {

Have a lovely day,
Alex


>             }
> \&
>             if (!strncmp(buffer, "END", sizeof(buffer))) {
> 

-- 
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-03-04 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 19:27 patch - fixing sample program in unix.7 Lili Püspök
2024-03-04 16:21 ` Alejandro Colomar [this message]
2024-03-04 16:41   ` Lili Püspök
2024-03-06 12:19     ` Alejandro Colomar
2024-03-06 20:02       ` Lili Püspök
2024-03-16  0:12         ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeX1JTt2Sxot-JFU@debian \
    --to=alx@kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=poordirtylili@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox