aboutsummaryrefslogtreecommitdiff
path: root/win32/system.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* win32: convert exit codesRon Yorston2023-09-141-6/+1
| | | | | | | | | | | | | | | | | Add two utility functions to convert Windows process exit codes. - exit_code_to_wait_status() converts to a POSIX wait status. This is used in ash and the implementations of system(3) and mingw_wait3(). - exit_code_to_posix() converts to a POSIX exit code. (Not that POSIX has much to say about them.) As a result it's possible for more applets to report when child processes are killed as if by a signal. 'time', 'drop' and 'su -W', for example. Adds 64-80 bytes.
* make: return non-zero exit status when a command failsRon Yorston2023-09-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a build command returned a non-zero exit status 'make' reported a warning and returned an exit code of zero. This was due to the misuse of the status returned by system(3). As the man page says: the return value is a "wait status" that can be examined using the macros described in waitpid(2). (i.e., WIFEXITED(), WEXITSTATUS(), and so on). Use the error() function to correctly report the problem on stderr and return an exit status of 2. Some additional changes in the same area: - When a target is removed report the diagnostic on stderr, as required by POSIX. - When a build command receives a signal GNU make removes the target. bmake doesn't and it isn't required by POSIX. Implement this as an extension. - Expand the error message when a build command fails so it includes the exit status or signal number, as obtained from the value returned by system(3). - Alter the WIN32 implementation of system(3) to handle exit codes which represent termination as if by a signal. Adds 200-240 bytes. (GitHub issue #354)
* win32/mingw: fix signatures of the *execv*() family of functionsJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | The function signatures were inherited from Git's source code, but are inconsistent with the declarations in the POSIX standard. This requires quite a few changes in quite a few callers, unfortunately. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* win32: rewrite implementation of system(3)Ron Yorston2017-07-311-66/+11
| | | | Rewrite mingw_system using mingw_spawn_proc. Also fix return values.
* mingw32: make system return wait status, not exit codeRon Yorston2012-05-041-1/+1
|
* mingw32: implement system(3) call using sh instead of cmd.exeRon Yorston2012-05-011-0/+77