projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: add func for string config change check
[project/procd.git]
/
initd
/
init.c
diff --git
a/initd/init.c
b/initd/init.c
index
9818c4f
..
0349e6e
100644
(file)
--- a/
initd/init.c
+++ b/
initd/init.c
@@
-86,30
+86,22
@@
main(int argc, char **argv)
if (!pid) {
char *kmod[] = { "/sbin/kmodloader", "/etc/modules-boot.d/", NULL };
if (!pid) {
char *kmod[] = { "/sbin/kmodloader", "/etc/modules-boot.d/", NULL };
- if (debug < 3) {
- int fd = open("/dev/null", O_RDWR);
-
- if (fd > -1) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO)
- close(fd);
- }
- }
+ if (debug < 3)
+ patch_stdio("/dev/null");
+
execvp(kmod[0], kmod);
execvp(kmod[0], kmod);
- ERROR("Failed to start kmodloader\n");
+ ERROR("Failed to start kmodloader
: %m
\n");
exit(-1);
}
if (pid <= 0) {
exit(-1);
}
if (pid <= 0) {
- ERROR("Failed to start kmodloader instance\n");
+ ERROR("Failed to start kmodloader instance
: %m
\n");
} else {
int i;
} else {
int i;
- for (i = 0; i < 120; i++) {
+ for (i = 0; i < 120
0
; i++) {
if (waitpid(pid, NULL, WNOHANG) > 0)
break;
if (waitpid(pid, NULL, WNOHANG) > 0)
break;
-
sleep(1
);
+
usleep(10 * 1000
);
watchdog_ping();
}
}
watchdog_ping();
}
}