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:
Augustin Cavalier
2026-02-27 10:13:46 -05:00
parent 9b5a7d7612
commit 27e95c346a
+1 -1
View File
@@ -430,7 +430,7 @@ process_spawnattr(const posix_spawnattr_t *_attr)
}
if ((attr->flags & POSIX_SPAWN_SETSID) != 0) {
if (setsid() != 0)
if (setsid() < 0)
return errno;
}