[141414] trunk/base/src/pextlib1.0/system.c

cal at macports.org cal at macports.org
Sat Dec 12 01:25:52 PST 2015


Revision: 141414
          https://trac.macports.org/changeset/141414
Author:   cal at macports.org
Date:     2015-10-17 17:06:39 -0700 (Sat, 17 Oct 2015)
Log Message:
-----------
base: pextlib/system: Use exit(3) to flush buffers

_exit(2) doesn't flush buffers that may be still in use, such as output printed
to stdout. Use exit(3) to simplify reporting a problem in a subprocess
pre-execve(2).

Additionally change the return value in case of a failed exec to 128 to signal
a failure in a subprocess; this is a convention often used by GNU software, and
I think it makes sense to help distinguishing this from a failure in the
executed program.

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/system.c

Modified: trunk/base/src/pextlib1.0/system.c
===================================================================
--- trunk/base/src/pextlib1.0/system.c	2015-10-17 23:27:05 UTC (rev 141413)
+++ trunk/base/src/pextlib1.0/system.c	2015-10-18 00:06:39 UTC (rev 141414)
@@ -245,7 +245,7 @@
             args[3] = NULL;
             execve("/bin/sh", args, environ);
         }
-        _exit(1);
+        exit(128);
         /*NOTREACHED*/
     default: /* parent */
         break;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/0c75e5de/attachment.html>


More information about the macports-changes mailing list