Commit 42a66ad4 authored by topjohnwu's avatar topjohnwu

Make starting daemon much easier

parent 2d1d70b3
...@@ -583,6 +583,19 @@ int run_daemon() { ...@@ -583,6 +583,19 @@ int run_daemon() {
prepare(); prepare();
switch (fork()) {
case 0:
break;
case -1:
PLOGE("fork");
return 1;
default:
return 0;
}
if (setsid() < 0 || setcon("u:r:su_daemon:s0") < 0)
return 1;
int fd; int fd;
struct sockaddr_un sun; struct sockaddr_un sun;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment