Changeset 1645 in MondoRescue for branches/2.2.5/mondo/src/mondoarchive


Ignore:
Timestamp:
Sep 24, 2007, 3:04:43 AM (18 years ago)
Author:
Bruno Cornec
Message:

Render bkpinfo global (potential issue on thread, but should not be a problem as that structure is indeed static during archive)
Should solve the tmpdir issue from previous rev.
May still not compile

Location:
branches/2.2.5/mondo/src/mondoarchive
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondoarchive/main.c

    r1644 r1645  
    146146extern int g_loglevel;
    147147
     148/* Reference to global bkpinfo */
     149struct s_bkpinfo *bkpinfo;
     150
    148151/****************** subroutines used only by main.c ******************/
    149152
     
    261264int main(int argc, char *argv[])
    262265{
    263     struct s_bkpinfo *bkpinfo;
    264266    char *tmp;
    265267    int res, retval;
     
    422424    }
    423425
    424     if (pre_param_configuration(bkpinfo)) {
     426    if (pre_param_configuration()) {
    425427        fatal_error
    426428            ("Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...");
     
    431433        g_text_mode = FALSE;
    432434        setup_newt_stuff();
    433         res = interactively_obtain_media_parameters_from_user(bkpinfo, TRUE);   /* yes, archiving */
     435        res = interactively_obtain_media_parameters_from_user(TRUE);    /* yes, archiving */
    434436        if (res) {
    435437            fatal_error
     
    437439        }
    438440    } else {
    439         res = handle_incoming_parameters(argc, argv, bkpinfo);
     441        res = handle_incoming_parameters(argc, argv);
    440442        if (res) {
    441443            printf
     
    449451
    450452/* Finish configuring global structures */
    451     if (post_param_configuration(bkpinfo)) {
     453    if (post_param_configuration()) {
    452454        fatal_error
    453455            ("Post-param initialization phase failed. Perhaps bad parameters were supplied to mondoarchive? Please review the documentation, error messages and logs. Exiting...");
     
    461463    /* If we're meant to backup then backup */
    462464    if (bkpinfo->backup_data) {
    463         res = backup_data(bkpinfo);
     465        res = backup_data();
    464466        retval += res;
    465467        if (res) {
     
    473475/* If we're meant to verify then verify */
    474476    if (bkpinfo->verify_data) {
    475         res = verify_data(bkpinfo);
     477        res = verify_data();
    476478        if (res < 0) {
    477479            sprintf(tmp, "%d difference%c found.", -res,
     
    486488/* Offer to write floppy disk images to physical disks */
    487489    if (bkpinfo->backup_data && !g_skip_floppies) {
    488         res = offer_to_write_boot_floppies_to_physical_disks(bkpinfo);
     490        res = offer_to_write_boot_floppies_to_physical_disks();
    489491        retval += res;
    490 //      res = offer_to_write_boot_ISO_to_physical_CD(bkpinfo);
     492//      res = offer_to_write_boot_ISO_to_physical_CD();
    491493//      retval += res;
    492494    }
  • branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c

    r1540 r1645  
    210210char *g_getfacl = NULL;
    211211char *g_getfattr = NULL;
     212
     213/* Reference to global bkpinfo */
     214extern struct s_bkpinfo *bkpinfo;
    212215
    213216/**
     
    223226 */
    224227int
    225 handle_incoming_parameters(int argc, char *argv[],
    226                            struct s_bkpinfo *bkpinfo)
     228handle_incoming_parameters(int argc, char *argv[])
    227229{
    228230    /*@ int *** */
     
    237239
    238240    malloc_string(tmp);
    239     sensibly_set_tmpdir_and_scratchdir(bkpinfo);
     241    sensibly_set_tmpdir_and_scratchdir();
    240242    for (i = 0; i < 128; i++) {
    241243        flag_val[i][0] = '\0';
     
    252254    retval += res;
    253255    if (!retval) {
    254         res = process_switches(bkpinfo, flag_val, flag_set);
     256        res = process_switches(flag_val, flag_set);
    255257        retval += res;
    256258    }
     
    293295 * @bug Return code not needed.
    294296 */
    295 int process_the_s_switch(struct s_bkpinfo *bkpinfo, char *value)
     297int process_the_s_switch(char *value)
    296298{
    297299    int j;
     
    337339 */
    338340int
    339 process_switches(struct s_bkpinfo *bkpinfo,
    340                  char flag_val[128][MAX_STR_LEN], bool flag_set[128])
     341process_switches(char flag_val[128][MAX_STR_LEN], bool flag_set[128])
    341342{
    342343
     
    602603                        ("For the moment, please don't specify a tape size. Mondo should handle end-of-tape gracefully anyway.");
    603604                }
    604                 if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     605                if (process_the_s_switch(flag_val['s'])) {
    605606                    fatal_error("Bad -s switch");
    606607                }
     
    616617    } else {                    /* CD size */
    617618        if (flag_set['s']) {
    618             if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     619            if (process_the_s_switch(flag_val['s'])) {
    619620                fatal_error("Bad -s switch");
    620621            }
Note: See TracChangeset for help on using the changeset viewer.