--- metalog.c-after-unpack 2003-05-06 11:48:21.000000000 -0700 +++ metalog.c 2003-05-06 12:24:02.000000000 -0700 @@ -700,7 +700,8 @@ 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)) { fprintf(stderr, "Unable to launch [%s]\n", @@ -711,10 +712,11 @@ if (command_child == (pid_t) 0) { execl(command, command, date, prg, info, 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; } @@ -886,8 +888,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 @@ -895,8 +895,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