git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2] run-command: detect finished children by closed pipe rather than waitpid

From
Stefan Beller <sbeller@google.com>
Date
Nov 23, 2015, 19:01 UTC
Message-ID
<CAGZ79kYte2-1ddbFOnWL5NFAuK6auLDD2n47Dz+6FcZCpC1vTA@mail.gmail.com>
In-Reply-To
<CAGZ79kYs9+UTx__yccy6qZY+Xn4onWx3zpH51pzHPn8Hz_FMww@mail.gmail.com>
On Mon, Nov 23, 2015 at 10:44 AM, Stefan Beller <sbeller@google.com> wrote:
Show 19 quoted lines
> On Fri, Nov 20, 2015 at 10:58 PM, Torsten Bögershausen <tboegi@web.de> wrote:
>> On 2015-11-20 22.08, Stefan Beller wrote:
>> The patch looks good at first glance, one minor remark below:
>>>
>>> diff --git a/run-command.c b/run-command.c
>>
>>> @@ -1071,70 +1089,31 @@ static void pp_output(struct parallel_processes *pp)
>>>
>>>  static int pp_collect_finished(struct parallel_processes *pp)
>>>  {
>>> -     int i = 0;
>>> -     pid_t pid;
>>> -     int wait_status, code;
>>> +     int i, code;
>>
>> code is probably "return code"?
>> woud "ret_value", "res" or "rc" make that more clear ?
>>
>

Although looking through the code, we have lots of functions having a local `code` variable, so we may want to preserve consistency across the different functions to have a `code`which contains the return value of the process or function invoked.

We had the `code` already in pp_collect_finished, so I'd like to not rename a variable (which was used for the same purpose) in this patch.

In pp_start_one we introduce a new variable `code` which contains the return from the user callback function, so I would understand if we were arguing there.

That said, I plan to resend with a reworded commit message later today.
Previous: Stefan Beller
Message 6 of 6 in “[PATCHv2] run-command: detect finished children by closed pipe rather than waitpid”
  1. Stefan BellerNov 20, 2015
  2. Jonathan NiederNov 20, 2015
  3. Johannes SixtNov 20, 2015
  4. Torsten BögershausenNov 21, 2015
  5. Stefan BellerNov 23, 2015
  6. Stefan BellerNov 23, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.