Changeset 68 in MondoRescue for trunk/mondo/mondo/common


Ignore:
Timestamp:
Oct 17, 2005, 2:37:16 PM (19 years ago)
Author:
andree
Message:

At the end of function run_program_and_log_to_screen, paranoid_pclose is
used to close the process stream. This means - as we don't evaluate the
exit code of the called program - that mondoarchive will happily
continue even if mondo has failed. Only later will it give an error when
it tries to burn an image that miondi has actually failed to create.

The change to libmondo-fork.c.diff addresses this by using pclose
directly (rather than the paranoid_pclose macro) and by then evaluating
the status information and extracting the exit code of the called
program.

The change to libmondo-archive.c makes it so that at the end of function
call_mindi_to_supply_boot_disks popup_and_OK is called in case of an
error rather than log_to_screen. This ensures that the main error is not
drowned in a sea of other messages.

Location:
trunk/mondo/mondo/common
Files:
2 edited

Legend:

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

    r59 r68  
    926926        paranoid_free(command);
    927927        if (strlen(tmp) > 1) {
    928             log_to_screen(tmp);
     928            popup_and_OK(tmp);
    929929        }
    930930        paranoid_free(tmp);
  • trunk/mondo/mondo/common/libmondo-fork.c

    r59 r68  
    473473    }
    474474#endif
    475     paranoid_pclose(fin);
    476     retval += res;
     475    /* Evaluate the status returned by pclose to get the exit code of the called program. */
     476    errno = 0;
     477    res = pclose(fin);
     478    /* Log actual pclose errors. */
     479    if (errno) log_msg(5, "pclose err: %d", errno);
     480    /* Check if we have a valid status. If we do, extract the called program's exit code. */
     481    /* If we don't, highlight this fact by returning -1. */
     482    if (WIFEXITED(res)) {
     483      retval = WEXITSTATUS(res);
     484    } else {
     485      retval = -1;
     486    }
    477487    close_evalcall_form();
    478488    unlink(lockfile);
Note: See TracChangeset for help on using the changeset viewer.