posix_spawn: Fix implementation of POSIX_SPAWN_SETSID.
setsid() returns -1 in case of error, and a pid_t in case of success.
This commit is contained in:
@@ -430,7 +430,7 @@ process_spawnattr(const posix_spawnattr_t *_attr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((attr->flags & POSIX_SPAWN_SETSID) != 0) {
|
if ((attr->flags & POSIX_SPAWN_SETSID) != 0) {
|
||||||
if (setsid() != 0)
|
if (setsid() < 0)
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user