Lines 700-706
Link Here
|
700 |
const char * const prg, const char * const info) |
700 |
const char * const prg, const char * const info) |
701 |
{ |
701 |
{ |
702 |
struct stat st; |
702 |
struct stat st; |
703 |
|
703 |
pid_t command_child; |
|
|
704 |
|
704 |
if (command == NULL || *command == 0 || |
705 |
if (command == NULL || *command == 0 || |
705 |
stat(command, &st) < 0 || !S_ISREG(st.st_mode)) { |
706 |
stat(command, &st) < 0 || !S_ISREG(st.st_mode)) { |
706 |
fprintf(stderr, "Unable to launch [%s]\n", |
707 |
fprintf(stderr, "Unable to launch [%s]\n", |
Lines 711-720
Link Here
|
711 |
if (command_child == (pid_t) 0) { |
712 |
if (command_child == (pid_t) 0) { |
712 |
execl(command, command, date, prg, info, NULL); |
713 |
execl(command, command, date, prg, info, NULL); |
713 |
_exit(EXIT_FAILURE); |
714 |
_exit(EXIT_FAILURE); |
714 |
} else if (command_child != (pid_t) -1) { |
715 |
} |
715 |
while (command_child != (pid_t) 0) { |
716 |
if (command_child == (pid_t) -1) { |
716 |
pause(); |
717 |
fprintf(stderr, "Unable to launch [%s] : [%s]\n", |
717 |
} |
718 |
command == NULL ? "null" : command, strerror(errno)); |
|
|
719 |
return -1; |
718 |
} |
720 |
} |
719 |
return 0; |
721 |
return 0; |
720 |
} |
722 |
} |
Lines 886-893
Link Here
|
886 |
if (pid == child) { |
888 |
if (pid == child) { |
887 |
fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); |
889 |
fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); |
888 |
should_exit = 1; |
890 |
should_exit = 1; |
889 |
} else if (pid == command_child) { |
|
|
890 |
command_child = (pid_t) 0; |
891 |
} |
891 |
} |
892 |
} |
892 |
} |
893 |
#else |
893 |
#else |
Lines 895-902
Link Here
|
895 |
if (pid == child) { |
895 |
if (pid == child) { |
896 |
fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); |
896 |
fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid); |
897 |
should_exit = 1; |
897 |
should_exit = 1; |
898 |
} else if (pid == command_child) { |
|
|
899 |
command_child = (pid_t) 0; |
900 |
} |
898 |
} |
901 |
} |
899 |
} |
902 |
#endif |
900 |
#endif |