summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/spawn.c b/spawn.c
index b356c41..8c360d3 100644
--- a/spawn.c
+++ b/spawn.c
@@ -190,7 +190,14 @@ static void bfs_spawn_exec(const char *exe, const struct bfs_spawn *ctx, char **
fail:
error = errno;
- while (write(pipefd[1], &error, sizeof(error)) < sizeof(error));
+
+ while (write(pipefd[1], &error, sizeof(error)) < 0) {
+ if (errno != EINTR) {
+ // Parent will still see that we exited unsuccessfully, but won't know why
+ break;
+ }
+ }
+
close(pipefd[1]);
_Exit(127);
}