diff options
Diffstat (limited to 'src/initlog.c')
-rw-r--r-- | src/initlog.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src/initlog.c b/src/initlog.c index 3b1cded6..ccf6375b 100644 --- a/src/initlog.c +++ b/src/initlog.c @@ -168,38 +168,6 @@ char **toArray(char *line, int *num) { return lines; } -int startDaemon() { - int pid; - int rc; - - if ( (pid = fork()) == -1 ) { - perror("fork"); - return -1; - } - if ( pid ) { - /* parent */ - waitpid(pid,&rc,0); - if (WIFEXITED(rc)) { - DDEBUG("minilogd returned %d!\n",WEXITSTATUS(rc)); - return WEXITSTATUS(rc); - } - else - return -1; - } else { - int fd; - - fd=open("/dev/null",O_RDWR); - dup2(fd,0); - dup2(fd,1); - dup2(fd,2); - close(fd); - /* kid */ - execlp("minilogd","minilogd",NULL); - perror("exec"); - exit(-1); - } -} - int trySocket() { int s; struct sockaddr_un addr; @@ -243,9 +211,7 @@ int logLine(struct logInfo *logEnt) { if (!logEnt->line || !strcmp(logEnt->line,"\n")) return 0; - if ( ((stat(_PATH_LOG,&statbuf)==-1) || trySocket()) - && startDaemon() - ) { + if ((stat(_PATH_LOG,&statbuf)==-1) || trySocket()) { DDEBUG("starting daemon failed, pooling entry %d\n",logEntries); logData=realloc(logData,(logEntries+1)*sizeof(struct logInfo)); logData[logEntries]= (*logEnt); @@ -461,5 +427,6 @@ int main(int argc, char **argv) { setlocale(LC_ALL,""); bindtextdomain("initlog","/etc/locale"); textdomain("initlog"); + fprintf(stderr, _("WARNING: initlog is deprecated and will be removed in a future release\n")); exit(processArgs(argc,argv,0)); } |