Changeset 3900 in MondoRescue for branches


Ignore:
Timestamp:
Dec 17, 2024, 11:28:04 PM (6 months ago)
Author:
Bruno Cornec
Message:

Only one creation of MNT_CDROM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/mondorestore/mondorestore.c

    r3893 r3900  
    1313#include "mr_mem.h"
    1414#include "mr_file.h"
     15#include "mr_msg.h"
     16#include "mr_str.h"
    1517#include "mondostructures.h"
    1618#include "mondorestore.h"
    17 #include "mr_msg.h"
    1819#include "mondo-rstr-compare-EXT.h"
    1920#include "mondo-rstr-tools-EXT.h"
     
    167168 * @ingroup restoreUtilityGroup
    168169 */
    169 bool
    170 partition_table_contains_Compaq_diagnostic_partition(struct mountlist_itself * mountlist) {
     170bool partition_table_contains_Compaq_diagnostic_partition(struct mountlist_itself * mountlist) {
    171171
    172172int i;
     
    905905 * @return 0 for success, or the number of filesets that failed.
    906906 */
    907 int
    908 restore_all_tarballs_from_CD(struct s_node *filelist)
    909 {
     907int restore_all_tarballs_from_CD(struct s_node *filelist) {
    910908    int retval = 0;
    911909    int res;
     
    18021800        closein_tape();
    18031801    } else {
    1804         mount_media(MNT_CDROM);
    1805         mvaddstr_and_log_it(g_currentY++, 0,
    1806                             "Restoring OS and data from CD/USB   ");
     1802        mvaddstr_and_log_it(g_currentY++, 0, "Restoring OS and data from CD/USB   ");
    18071803        resA = restore_all_tarballs_from_CD(filelist);
    18081804        resB = restore_all_biggiefiles_from_CD(filelist);
     
    25632559        exit(127);
    25642560    }
    2565     if (!
    2566         (bkpinfo = malloc(sizeof(struct s_bkpinfo)))) {
    2567         fatal_error("Cannot malloc bkpinfo");
    2568     }
     2561    alloc_bkpinfo();
    25692562    reset_bkpinfo();
    25702563
    25712564    g_loglevel = DEFAULT_MR_LOGLEVEL;
    25722565
    2573 /* Configure global variables */
     2566    /* Configure global variables */
    25742567    tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
    25752568    if (strstr(tmp, "textonly")) {
     
    25952588    tmp = call_program_and_get_last_line_of_output("which mondorestore");
    25962589    strcpy(g_mondo_home, tmp);
    2597         mr_free(tmp);
     2590    mr_free(tmp);
    25982591
    25992592    g_current_media_number = 1; // precaution
    2600     run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE);
     2593    if (!does_file_exist(MNT_CDROM)) {
     2594        res = run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE);
     2595        if ( res != 0) {
     2596            fatal_error("Unable to create " MNT_CDROM);
     2597        }
     2598    }
    26012599
    26022600    setup_MR_global_filenames();    // malloc() and set globals, using bkpinfo->tmpdir etc.
     
    26162614            ("Serious error in malloc()'ing. Could be a bug in your glibc.");
    26172615    }
    2618     mkdir(MNT_CDROM, 0x770);
    26192616    make_hole_for_dir(MONDO_CACHE);
    26202617
     
    27812778    /*  setup log level for new log system as well */
    27822779    mr_msg_init(MONDO_LOGFILE,g_loglevel,argc,argv);
     2780    log_msg(0, "Time started: %s", mr_date());
    27832781
    27842782    // Handle params here first
Note: See TracChangeset for help on using the changeset viewer.