Changeset 141414 for trunk/base


Ignore:
Timestamp:
Oct 18, 2015, 12:06:39 AM (4 years ago)
Author:
cal@…
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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/pextlib1.0/system.c

    r138943 r141414  
    246246            execve("/bin/sh", args, environ);
    247247        }
    248         _exit(1);
     248        exit(128);
    249249        /*NOTREACHED*/
    250250    default: /* parent */
Note: See TracChangeset for help on using the changeset viewer.