about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/process/posix_spawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c
index c55907d3..dd450129 100644
--- a/src/process/posix_spawn.c
+++ b/src/process/posix_spawn.c
@@ -152,7 +152,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
 	close(args.p[1]);
 
 	if (pid > 0) {
-		if (read(args.p[0], &ec, sizeof ec) < sizeof ec) ec = 0;
+		if (read(args.p[0], &ec, sizeof ec) != sizeof ec) ec = 0;
 		else waitpid(pid, &(int){0}, 0);
 	} else {
 		ec = -pid;