When the child process encounters an error before its program is invoked, this is called to report the error to the parent and exit. */
| 2322 | invoked, this is called to report the error to the parent and |
| 2323 | exit. */ |
| 2324 | static void kwsysProcessChildErrorExit(int errorPipe) |
| 2325 | { |
| 2326 | /* Construct the error message. */ |
| 2327 | char buffer[KWSYSPE_PIPE_BUFFER_SIZE]; |
| 2328 | kwsysProcess_ssize_t result; |
| 2329 | strncpy(buffer, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE); |
| 2330 | buffer[KWSYSPE_PIPE_BUFFER_SIZE - 1] = '\0'; |
| 2331 | |
| 2332 | /* Report the error to the parent through the special pipe. */ |
| 2333 | result = write(errorPipe, buffer, strlen(buffer)); |
| 2334 | (void)result; |
| 2335 | |
| 2336 | /* Terminate without cleanup. */ |
| 2337 | _exit(1); |
| 2338 | } |
| 2339 | |
| 2340 | /* Restores all signal handlers to their default values. */ |
| 2341 | static void kwsysProcessRestoreDefaultSignalHandlers(void) |
no test coverage detected
searching dependent graphs…