Changeset 393 in MondoRescue for trunk/mondo/mondo/common/libmondo-files.c


Ignore:
Timestamp:
Feb 15, 2006, 10:06:13 AM (18 years ago)
Author:
andree
Message:

Made it so that mondoarchive aborts when 'mindi --findkernel' gives a
fatal error and outputs mindi's fatal error message in a newt popup.
This should help making it easier for users to get to the core of the
problem in case mindi fails.
(See also Debian bug #352323. Patch adjusted to use asprintf.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-files.c

    r300 r393  
    273273{
    274274    char *tmp;
     275    char *command;
    275276
    276277    if (!kernel[0]) {
     
    278279               call_program_and_get_last_line_of_output
    279280               ("mindi --findkernel 2> /dev/null"));
     281    }
     282    // If we didn't get anything back, check whether mindi raised a fatal error
     283    if (!kernel[0]) {
     284        asprintf(&command, "grep 'Fatal error' /var/log/mindi.log");
     285        asprintf(&tmp, call_program_and_get_last_line_of_output(command));
     286        if (strlen(tmp) > 1) {
     287            popup_and_OK(tmp);
     288            fatal_error("Mindi gave a fatal error. Please check '/var/log/mindi.log'.");
     289        }
     290        paranoid_free(command);
     291        paranoid_free(tmp);
    280292    }
    281293    log_it("Calling Mindi with kernel path of '%s'", kernel);
Note: See TracChangeset for help on using the changeset viewer.