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

Re: [PATCH v2] daemon: correctly handle soft accept() errors in service_loop

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 27, 2025, 23:53 UTC
Message-ID
<xmqqy0tc68s4.fsf@gitster.g>
In-Reply-To
<vgailqqh3bcip3gxtdffoo4ey7xjso4xerewxncy22shrzn4k2@25hst4sfgxq4>
Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
Show 13 quoted lines
>> 		socklen_t sslen = sizeof(ss);
>> -		int incoming = accept(pfd[i].fd, &ss.sa, &sslen);
>> +		int incoming;
>> +		int retry = 3;
>> +
>> +		incoming = accept(pfd[i].fd, &ss.sa, &sslen);
>> 		if (incoming < 0) {
>> 			...
>
> That seems unnecessarily restrictive just to minimize churn and leaves the
> deflaration of incoming strangely sitting in between two assignments, which
> while it doesn't trigger -Wdeclaration-after-statement seems to go against
> its spirit.

Hmph, I am not Phillip, but my take on it is that incoming and retry are fairly closely related variables in this loop, and better grouped together?

I also find it a bit ugly to hardcode "3" here like this, but perhaps I am overthinking about it.

Previous: Hridoy AhmedNext: Phillip Wood
Message 9 of 14 in “daemon: correctly handle soft accept() errors”
  1. daemon: correctly handle soft accept() errorsCarlo Marcelo Arenas Belón, Jun 26, 2025
  2. Kristoffer HaugsbakkJun 26, 2025
  3. daemon: correctly handle soft accept() errors in service_loopCarlo Marcelo Arenas Belón, Jun 26, 2025
  4. Phillip WoodJun 27, 2025
  5. Carlo Marcelo Arenas BelónJun 27, 2025
  6. Junio C HamanoJun 27, 2025
  7. Carlo Marcelo Arenas BelónJun 27, 2025
  8. Hridoy AhmedJun 27, 2025
  9. Junio C HamanoJun 27, 2025
  10. Phillip WoodJun 30, 2025
  11. daemon: correctly handle soft accept() errors in service_loopCarlo Marcelo Arenas Belón, Jun 27, 2025
  12. Phillip WoodJun 30, 2025
  13. Junio C HamanoJun 30, 2025
  14. Phillip WoodJul 1, 2025

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.