Ignore:
Timestamp:
Aug 18, 2009, 2:37:55 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3332@localhost: bruno | 2009-08-07 23:59:34 +0200

  • bkpinfo->tmpchdir is now dynamically allocated
  • reorganize how tmpdir and scratchdir are initialized and the startup of the main sections
  • change of interface for maintain_collection_of_recent_archives, mondo_makefilelist, chop_filelist
  • sensibly_set_tmpdir_and_scratchdir => sensibly_set_scratchdir
  • reset_bkpinfo => init_bkpinfo
  • add function mr_free_bkpinfo
  • Fix a bug in mr_strtok
  • mondoarchive seems to globally work. Newt stuff needs more testing
File:
1 edited

Legend:

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

    r2320 r2321  
    27202720        exit(127);
    27212721    }
    2722     if (!
    2723         (bkpinfo = malloc(sizeof(struct s_bkpinfo)))) {
    2724         fatal_error("Cannot malloc bkpinfo");
    2725     }
    2726     reset_bkpinfo();
     2722    bkpinfo = (struct s_bkpinfo *)mr_malloc(sizeof(struct s_bkpinfo));
     2723    init_bkpinfo();
    27272724
    27282725    g_loglevel = DEFAULT_MR_LOGLEVEL;
    27292726
    2730 /* Configure global variables */
     2727    /* Configure global variables */
     2728    malloc_libmondo_global_strings();
    27312729#ifdef __FreeBSD__
    2732     if (strstr
    2733         (call_program_and_get_last_line_of_output("cat /tmp/cmdline"),
    2734          "textonly"))
     2730    if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "textonly"))
    27352731#else
    2736     if (strstr
    2737         (call_program_and_get_last_line_of_output("cat /proc/cmdline"),
    2738          "textonly"))
     2732    if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "textonly"))
    27392733#endif
    27402734    {
     
    27442738        g_text_mode = FALSE;
    27452739    }                           // newt :-)
    2746     if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
    2747         fatal_error("Cannot malloc mountlist");
    2748     }
    2749     if (!(raidlist = malloc(sizeof(struct raidlist_itself)))) {
    2750         fatal_error("Cannot malloc raidlist");
    2751     }
    2752 
    2753     malloc_libmondo_global_strings();
    2754 
    2755     strcpy(g_mondo_home,
    2756            call_program_and_get_last_line_of_output("which mondorestore"));
     2740
     2741    /* Init GUI */
     2742    setup_newt_stuff();         /* call newtInit and setup screen log */
     2743
     2744    strcpy(g_mondo_home, call_program_and_get_last_line_of_output("which mondorestore"));
    27572745    g_current_media_number = 1; // precaution
    27582746
     
    27742762    log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
    27752763    if (strlen(g_mountlist_fname) < 3) {
    2776         fatal_error
    2777             ("Serious error in malloc()'ing. Could be a bug in your glibc.");
     2764        fatal_error("Serious error in malloc()'ing. Could be a bug in your glibc.");
    27782765    }
    27792766    mkdir(MNT_CDROM, 0x770);
     
    27832770    mr_asprintf(&tmp, "%s.orig", g_mountlist_fname);
    27842771    if (!does_file_exist(g_mountlist_fname)) {
    2785         log_msg(2,
    2786                 "%ld: Warning - g_mountlist_fname (%s) does not exist yet",
    2787                 __LINE__, g_mountlist_fname);
     2772        log_msg(2, "%ld: Warning - g_mountlist_fname (%s) does not exist yet", __LINE__, g_mountlist_fname);
    27882773    } else if (!does_file_exist(tmp)) {
    27892774        mr_free(tmp);
     
    27972782    make_hole_for_dir("/tmp/tmpfs");    /* just in case... */
    27982783    run_program_and_log_output("umount " MNT_CDROM, FALSE);
    2799     /*
    2800     run_program_and_log_output("ln -sf /var/log/mondo-archive.log /tmp/mondorestore.log",
    2801          FALSE);
    2802          */
    28032784
    28042785    run_program_and_log_output("rm -Rf /tmp/tmpfs/mondo.tmp.*", FALSE);
    28052786
    2806     /* Init GUI */
    2807     setup_newt_stuff();         /* call newtInit and setup screen log */
    28082787    welcome_to_mondorestore();
    28092788    if (bkpinfo->disaster_recovery) {
     
    28142793
    28152794    log_it("what time is it");
     2795
     2796    mountlist = (struct mountlist_itself *)mr_malloc(sizeof(struct mountlist_itself));
     2797    raidlist = (struct raidlist_itself *)mr_malloc(sizeof(struct raidlist_itself));
    28162798
    28172799    /* Process command-line parameters */
Note: See TracChangeset for help on using the changeset viewer.