Explicitly ignore interruptions in spawnvp() - noice - small file browser (mirror / fork from 2f30.org)
HTML git clone git://git.codemadness.org/noice
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 784551aa55ff996e103443d1bbe65684fd4d7463
DIR parent c19a624e3b5346da6fa6dbc7c4eb44a4d2a2fdce
HTML Author: sin <sin@2f30.org>
Date: Tue, 6 Aug 2019 14:28:52 +0100
Explicitly ignore interruptions in spawnvp()
Diffstat:
M spawn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/spawn.c b/spawn.c
@@ -3,6 +3,7 @@
#include <sys/wait.h>
#include <err.h>
+#include <errno.h>
#include <stdarg.h>
#include <unistd.h>
@@ -24,8 +25,7 @@ spawnvp(char *dir, char *file, char *argv[])
execvp(file, argv);
_exit(1);
default:
- /* Ignore interruptions */
- while (waitpid(pid, &status, 0) == -1)
+ while (waitpid(pid, &status, 0) == -1 && errno == EINTR)
;
}
}