Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:48

Jonathan Nieder [off-list ref] writes:
 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help