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

Re: [PATCH v2] run-command: prettify -D_FORTIFY_SOURCE workaround

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2011, 22:34 UTC
Message-ID
<7vipvh1iml.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110316073239.GJ5988@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 10 quoted lines
>  static NORETURN void die_child(const char *err, va_list params)
>  {
> ...
> -	unused = write(child_err, "fatal: ", 7);
> -	unused = write(child_err, msg, len);
> -	unused = write(child_err, "\n", 1);
> +	if (write(child_err, "fatal: ", 7) ||
> +	    write(child_err, msg, len) ||
> +	    write(child_err, "\n", 1))
> +		; /* yes, gcc -D_FORTIFY_SOURCE, we know there was an error. */

Strictly speaking, this changes behaviour by stopping at the first failure from write(2), but I don't think we care.

Thanks.
Previous: Jonathan NiederNext: Johannes Sixt
Message 6 of 8 in “run-command.c: fix build warnings on Ubuntu”
  1. run-command.c: fix build warnings on UbuntuMichael Wookey, Jan 29, 2010
  2. Markus HeidelbergJan 30, 2010
  3. run-command: prettify -D_FORTIFY_SOURCE workaroundJonathan Nieder, Mar 16, 2011
  4. Junio C HamanoMar 16, 2011
  5. run-command: prettify -D_FORTIFY_SOURCE workaroundJonathan Nieder, Mar 16, 2011
  6. Junio C HamanoMar 17, 2011
  7. Johannes SixtMar 16, 2011
  8. Jonathan NiederMar 16, 2011

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.