projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c7a307
)
nixio: add setsid()
author
Steven Barth
<steven@midlink.org>
Thu, 12 Mar 2009 21:31:57 +0000
(21:31 +0000)
committer
Steven Barth
<steven@midlink.org>
Thu, 12 Mar 2009 21:31:57 +0000
(21:31 +0000)
libs/nixio/src/process.c
patch
|
blob
|
history
diff --git
a/libs/nixio/src/process.c
b/libs/nixio/src/process.c
index 0d60ed19055ffea0619a11f6da55e03182145f55..65d6209008f437e5a3570b52c981accd3f119a76 100644
(file)
--- a/
libs/nixio/src/process.c
+++ b/
libs/nixio/src/process.c
@@
-163,6
+163,17
@@
static int nixio_nice(lua_State *L) {
}
}
+static int nixio_setsid(lua_State *L) {
+ pid_t pid = setsid();
+
+ if (pid == -1) {
+ return nixio__perror(L);
+ } else {
+ lua_pushinteger(L, pid);
+ return 1;
+ }
+}
+
/* module table */
static const luaL_reg R[] = {
@@
-176,6
+187,7
@@
static const luaL_reg R[] = {
{"getgid", nixio_getgid},
{"setuid", nixio_setuid},
{"setgid", nixio_setgid},
+ {"setsid", nixio_setsid},
{"signal", nixio_signal},
{NULL, NULL}
};