projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
explicitely ignore return value of symlink(3) call
[project/procd.git]
/
procd.c
diff --git
a/procd.c
b/procd.c
index
a72912a
..
e41d98a
100644
(file)
--- a/
procd.c
+++ b/
procd.c
@@
-15,6
+15,7
@@
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/reboot.h>
#include <unistd.h>
#include <getopt.h>
#include <unistd.h>
#include <getopt.h>
@@
-32,7
+33,7
@@
static int usage(const char *prog)
"Options:\n"
"\t-s <path>\tPath to ubus socket\n"
"\t-h <path>\trun as hotplug daemon\n"
"Options:\n"
"\t-s <path>\tPath to ubus socket\n"
"\t-h <path>\trun as hotplug daemon\n"
- "\t
d\t
\tEnable debug messages\n"
+ "\t
-d <level>
\tEnable debug messages\n"
"\n", prog);
return 1;
}
"\n", prog);
return 1;
}
@@
-40,8
+41,16
@@
static int usage(const char *prog)
int main(int argc, char **argv)
{
int ch;
int main(int argc, char **argv)
{
int ch;
+ char *dbglvl = getenv("DBGLVL");
- while ((ch = getopt(argc, argv, "ds:h:")) != -1) {
+ ulog_open(ULOG_KMSG, LOG_DAEMON, "procd");
+
+ if (dbglvl) {
+ debug = atoi(dbglvl);
+ unsetenv("DBGLVL");
+ }
+
+ while ((ch = getopt(argc, argv, "d:s:h:")) != -1) {
switch (ch) {
case 'h':
return hotplug_run(optarg);
switch (ch) {
case 'h':
return hotplug_run(optarg);
@@
-49,12
+58,13
@@
int main(int argc, char **argv)
ubus_socket = optarg;
break;
case 'd':
ubus_socket = optarg;
break;
case 'd':
- debug
++
;
+ debug
= atoi(optarg)
;
break;
default:
return usage(argv[0]);
}
}
break;
default:
return usage(argv[0]);
}
}
+ setsid();
uloop_init();
procd_signal();
trigger_init();
uloop_init();
procd_signal();
trigger_init();
@@
-63,6
+73,7
@@
int main(int argc, char **argv)
else
procd_state_next();
uloop_run();
else
procd_state_next();
uloop_run();
+ uloop_done();
return 0;
}
return 0;
}