Ignore:
Timestamp:
Sep 24, 2009, 3:50:38 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Remove some compiler warnings on main
  • Adds function mr_chomp and mr_strip_char and use them in mr_date and call_program_and_get_last_line_of_output
  • Fix call_program_and_get_last_line_of_output to return the right result using a temp file instead of popen
  • Fix an issue in mr_getline_int in case of eof (returns now an empty string)
  • Sequencing of Init of bkpinfo reviewed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2406 r2421  
    803803    bkpinfo = (struct s_bkpinfo *)mr_malloc(sizeof(struct s_bkpinfo));
    804804
     805    /*  We need tmpdir as early as possible for further function calls */
     806    bkpinfo->tmpdir = NULL;         // Really setup after
     807    setup_tmpdir(NULL);
     808
    805809    /* Initialized in same order as in the structure declaration to detect errors more easily */
    806810    bkpinfo->media_device = NULL;
     
    822826    bkpinfo->use_star = FALSE;
    823827    bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
    824     bkpinfo->disaster_recovery = (am_I_in_disaster_recovery_mode()? TRUE : FALSE);
     828    bkpinfo->disaster_recovery = am_I_in_disaster_recovery_mode();
    825829    if (bkpinfo->disaster_recovery) {
    826830        mr_asprintf(bkpinfo->isodir, "%s", "/");
     
    829833    }
    830834    mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX);
     835    /*   bkpinfo->tmpdir is here in the struct */
    831836    bkpinfo->scratchdir = NULL;     // Really setup after
    832     bkpinfo->tmpdir = NULL;         // Really setup after
    833837    bkpinfo->optimal_set_size = 0;
    834838    bkpinfo->backup_media_type = none;
     
    857861    bkpinfo->restore_mode = interactive;
    858862
    859     setup_tmpdir(NULL);
    860863    sensibly_set_scratchdir();
    861864}
     
    13641367        va_end(args);
    13651368
    1366         // do not slow down the progran if standard debug level
    1367         // must be enabled: if no flush, the log won't be up-to-date if there
    1368         // is a segfault
    1369         //if (g_dwDebugLevel != 1)
    1370 
    13711369        fprintf(fout, "\n");
    13721370        paranoid_fclose(fout);
Note: See TracChangeset for help on using the changeset viewer.