hrev52840 adds 1 changeset to branch 'master'
old head: f0a99f2bea2fc2ff40c6f240b2c2c944ba9c8394
new head: af615399189deeec8d412ec165ab638326471ab1
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=af615399189d+%5Ef0a99f2bea2f
----------------------------------------------------------------------------
af615399189d: posix_spawn: add POSIX_SPAWN_SETSID.
see http://austingroupbugs.net/view.php?id=1044
Change-Id: I9ae4fe07ea0fa7e20eb9a1d8c64e971e7353bcff
Reviewed-on: https://review.haiku-os.org/c/1008
Reviewed-by: Rene Gollent <rene@xxxxxxxxxxx>
[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52840
Commit: af615399189deeec8d412ec165ab638326471ab1
URL: https://git.haiku-os.org/haiku/commit/?id=af615399189d
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Mon Feb 4 18:34:13 2019 UTC
Committer: Adrien Destugues <pulkomandy@xxxxxxxxx>
Commit-Date: Mon Feb 4 19:21:30 2019 UTC
----------------------------------------------------------------------------
2 files changed, 6 insertions(+)
headers/posix/spawn.h | 1 +
src/system/libroot/posix/spawn.cpp | 5 +++++
----------------------------------------------------------------------------
diff --git a/headers/posix/spawn.h b/headers/posix/spawn.h
index 4726b53a0e..c3a0b1412d 100644
--- a/headers/posix/spawn.h
+++ b/headers/posix/spawn.h
@@ -23,6 +23,7 @@
#endif /* 0 */
#define POSIX_SPAWN_SETSIGDEF 0x10
#define POSIX_SPAWN_SETSIGMASK 0x20
+#define POSIX_SPAWN_SETSID 0x40
typedef struct _posix_spawnattr *posix_spawnattr_t;
diff --git a/src/system/libroot/posix/spawn.cpp
b/src/system/libroot/posix/spawn.cpp
index 5bbd454f50..473a3b067d 100644
--- a/src/system/libroot/posix/spawn.cpp
+++ b/src/system/libroot/posix/spawn.cpp
@@ -361,6 +361,11 @@ process_spawnattr(const posix_spawnattr_t *_attr)
return errno;
}
+ if ((attr->flags & POSIX_SPAWN_SETSID) != 0) {
+ if (setsid() != 0)
+ return errno;
+ }
+
if ((attr->flags & POSIX_SPAWN_SETPGROUP) != 0) {
if (setpgid(0, attr->pgroup) != 0)
return errno;