From c45ffd7f30263049d6316034119682fd89cedff7 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 31 Mar 2005 20:52:04 +0000 Subject: bring back initlog for third-party scripts. officially deprecate it --- src/initlog.c | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'src/initlog.c') 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)); } -- cgit v1.2.1