Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 8607 | Differences between
and this patch

Collapse All | Expand All

(-)src/metalog.c.bkp (-8 / +6 lines)
Lines 844-849 Link Here
844
                        const char * const prg, const char * const info)
844
                        const char * const prg, const char * const info)
845
{
845
{
846
    struct stat st;
846
    struct stat st;
847
    pid_t command_child;
847
    
848
    
848
    if (command == NULL || *command == 0 ||
849
    if (command == NULL || *command == 0 ||
849
        stat(command, &st) < 0 || !S_ISREG(st.st_mode)) {
850
        stat(command, &st) < 0 || !S_ISREG(st.st_mode)) {
Lines 855-864 Link Here
855
    if (command_child == (pid_t) 0) {
856
    if (command_child == (pid_t) 0) {
856
        execl(command, command, date, prg, info, (char *) NULL);
857
        execl(command, command, date, prg, info, (char *) NULL);
857
        _exit(EXIT_FAILURE);
858
        _exit(EXIT_FAILURE);
858
    } else if (command_child != (pid_t) -1) {
859
    }
859
        while (command_child != (pid_t) 0) {
860
    if (command_child == (pid_t) -1) {
860
            pause();
861
        fprintf(stderr, "Unable to launch [%s] : [%s]\n",
861
        }
862
                command == NULL ? "null" : command, strerror(errno));
863
        return -1;
862
    }
864
    }
863
    return 0;
865
    return 0;
864
}
866
}
Lines 1126-1133 Link Here
1126
        if (pid == child) {
1128
        if (pid == child) {
1127
            fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid);
1129
            fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid);
1128
            should_exit = 1;
1130
            should_exit = 1;
1129
        } else if (pid == command_child) {
1130
            command_child = (pid_t) 0;
1131
        }
1131
        }
1132
    }
1132
    }
1133
#else
1133
#else
Lines 1135-1142 Link Here
1135
        if (pid == child) {
1135
        if (pid == child) {
1136
            fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid);
1136
            fprintf(stderr, "Klog child [%u] died\n", (unsigned) pid);
1137
            should_exit = 1;
1137
            should_exit = 1;
1138
        } else if (pid == command_child) {
1139
            command_child = (pid_t) 0;
1140
        }
1138
        }
1141
    }    
1139
    }    
1142
#endif
1140
#endif

Return to bug 8607