--- src/metalog.c.bkp 2003-04-07 15:00:57.000000000 +0200 +++ src/metalog.c 2003-04-16 21:56:52.000000000 +0200 @@ -844,6 +844,7 @@ const char * const prg, const char * const info) { struct stat st; + pid_t command_child; if (command == NULL || *command == 0 || stat(command, &st) < 0 || !S_ISREG(st.st_mode)) { @@ -855,10 +856,11 @@ if (command_child == (pid_t) 0) { execl(command, command, date, prg, info, (char *) NULL); _exit(EXIT_FAILURE); - } else if (command_child != (pid_t) -1) { - while (command_child != (pid_t) 0) { - pause(); - } + } + if (command_child == (pid_t) -1) { + fprintf(stderr, "Unable to launch [%s] : [%s]\n", + command == NULL ? "null" : command, strerror(errno)); + return -1; } return 0; } @@ -1126,8 +1128,6 @@ if (pid == child) { fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); should_exit = 1; - } else if (pid == command_child) { - command_child = (pid_t) 0; } } #else @@ -1135,8 +1135,6 @@ if (pid == child) { fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); should_exit = 1; - } else if (pid == command_child) { - command_child = (pid_t) 0; } } #endif