diff options
| author | Ned T. Crigler <crigler@gmail.com> | 2025-06-19 20:03:57 -0700 |
|---|---|---|
| committer | Ned T. Crigler <crigler@gmail.com> | 2025-06-19 20:30:31 -0700 |
| commit | e34e2bb3c703aa8c47d85ba4b4a86f6ae5dc0404 (patch) | |
| tree | 134ffc985ae99e6b09cb76ad9ea2315c57150404 | |
| parent | dc84bf8b0f70af92f894209d2cf68eaff55db9f0 (diff) | |
Handle partial reads of the execvp error string
It is possible that reading the entire error string requires multiple
read() calls.
| -rw-r--r-- | master.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -672,7 +672,12 @@ master_main(char **argv, int waitattach, int dontfork) len = read(fd[0], buf, sizeof(buf)); if (len > 0) { - write_buf_or_fail(2, buf, len); + do + { + write_buf_or_fail(2, buf, len); + len = read(fd[0], buf, sizeof(buf)); + } while (len > 0); + kill(pid, SIGTERM); return 1; } |
