aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-04-09 02:29:09 +0000
committerBill Nottingham <notting@redhat.com>1999-04-09 02:29:09 +0000
commite8dcf9d4cf078a8cc8dd647000db737fc8a020b7 (patch)
tree103b063623afce74adafd5dbc1d4b77b65a4e506 /src/process.c
parent44e8ff24a4a674818c27e9435274333a99c4e02e (diff)
downloadinitscripts-e8dcf9d4cf078a8cc8dd647000db737fc8a020b7.tar
initscripts-e8dcf9d4cf078a8cc8dd647000db737fc8a020b7.tar.gz
initscripts-e8dcf9d4cf078a8cc8dd647000db737fc8a020b7.tar.bz2
initscripts-e8dcf9d4cf078a8cc8dd647000db737fc8a020b7.tar.xz
initscripts-e8dcf9d4cf078a8cc8dd647000db737fc8a020b7.zip
fixeds for the case where /dev/log exists at boot
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c
index f462a1de..0681b8f4 100644
--- a/src/process.c
+++ b/src/process.c
@@ -97,7 +97,7 @@ int forkCommand(char **args, int *outfd, int *errfd, int *cmdfd, int quiet) {
}
}
-int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet) {
+int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet, int debug) {
struct pollfd *pfds;
char *buf=malloc(2048*sizeof(char));
int outpipe[2];
@@ -144,6 +144,7 @@ int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet)
if (!reexec) {
if (getenv("IN_INITLOG")) {
char *buffer=calloc(2048,sizeof(char));
+ DDEBUG("sending =%s= to initlog parent\n",tmpstr);
snprintf(buffer,2048,"-n %s -s \"%s\"\n",
cmdname,tmpstr);
write(CMD_FD,buffer,strlen(buffer));
@@ -151,8 +152,7 @@ int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet)
} else {
logString(cmdname,tmpstr);
}
- }
- else {
+ } else {
char **cmdargs=NULL;
char **tmpargs=NULL;
int cmdargc,x;
@@ -191,7 +191,7 @@ int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet)
return 0;
}
-int runCommand(char *cmd, int reexec, int quiet) {
+int runCommand(char *cmd, int reexec, int quiet, int debug) {
int fds[2];
int pid,x;
char **args, **tmpargs;
@@ -212,12 +212,12 @@ int runCommand(char *cmd, int reexec, int quiet) {
cmdname+=3;
if (!reexec) {
pid=forkCommand(args,&fds[0],&fds[1],NULL,quiet);
- x=monitor(cmdname,pid,2,fds,reexec,quiet);
+ x=monitor(cmdname,pid,2,fds,reexec,quiet,debug);
} else {
setenv("IN_INITLOG","yes",1);
pid=forkCommand(args,NULL,NULL,&fds[0],quiet);
unsetenv("IN_INITLOG");
- x=monitor(cmdname,pid,1,&fds[0],reexec,quiet);
+ x=monitor(cmdname,pid,1,&fds[0],reexec,quiet,debug);
}
return x;
}