projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
fb6b159
)
fix unsigned comparison bug in posix_spawn
author
Rich Felker
<dalias@aerifal.cx>
Sun, 3 Feb 2013 22:09:47 +0000
(17:09 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Sun, 3 Feb 2013 22:09:47 +0000
(17:09 -0500)
read should never return anything but 0 or sizeof ec here, but if it
does, we want to treat any other return as "success". then the caller
will get back the pid and is responsible for waiting on it when it
immediately exits.
src/process/posix_spawn.c
patch
|
blob
|
history
diff --git
a/src/process/posix_spawn.c
b/src/process/posix_spawn.c
index
c55907d
..
dd45012
100644
(file)
--- 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;