Ignore:
Timestamp:
Sep 24, 2007, 3:04:43 AM (17 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c

    r1640 r1645  
    162162extern char *MONDO_LOGFILE;
    163163
     164/* Reference to global bkpinfo */
     165extern struct s_bkpinfo *bkpinfo;
     166
    164167/* Should we use or not extended attributes and acl when restoring */
    165168char *g_getfattr = NULL;
     
    285288*/
    286289int
    287 extract_config_file_from_ramdisk(struct s_bkpinfo *bkpinfo,
    288                          char *ramdisk_fname,
     290extract_config_file_from_ramdisk(char *ramdisk_fname,
    289291                         char *output_cfg_file,
    290292                         char *output_mountlist_file)
     
    354356/**
    355357* Keep trying to get mondo-restore.cfg from the archive, until the user gives up.
    356 * @param bkpinfo The backup information structure.
    357358*/
    358 void get_cfg_file_from_archive_or_bust(struct s_bkpinfo *bkpinfo)
    359 {
    360 while (get_cfg_file_from_archive(bkpinfo)) {
     359void get_cfg_file_from_archive_or_bust()
     360{
     361while (get_cfg_file_from_archive()) {
    361362if (!ask_me_yes_or_no
    362363    ("Failed to find config file/archives. Choose another source?"))
     
    364365    fatal_error("Could not find config file/archives. Aborting.");
    365366}
    366 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     367interactively_obtain_media_parameters_from_user(FALSE);
    367368}
    368369}
     
    432433* @return 0 for success, nonzero for failure.
    433434*/
    434 int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please)
     435int iso_fiddly_bits(bool nuke_me_please)
    435436{
    436437char *mount_isodir_command, *tmp, *command;
     
    488489}
    489490if (!IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    490 mount_cdrom(bkpinfo);
    491 }
    492 i = what_number_cd_is_this(bkpinfo);    /* has the side-effect of calling mount_cdrom() */
     491mount_cdrom();
     492}
     493i = what_number_cd_is_this();   /* has the side-effect of calling mount_cdrom() */
    493494sprintf(tmp, "%s #%d has been mounted via loopback mount",
    494495    media_descriptor_string(bkpinfo->backup_media_type), i);
     
    637638* @return 0 for success, nonzero for failure.
    638639*/
    639 int mount_cdrom(struct s_bkpinfo *bkpinfo)
     640int mount_cdrom()
    640641{
    641642char *mount_cmd;
     
    906907* @return 0 for success, nonzero for failure.
    907908*/
    908 int read_cfg_file_into_bkpinfo(char *cfgf, struct s_bkpinfo *bkpinfo)
     909int read_cfg_file_into_bkpinfo(char *cfgf)
    909910{
    910911/** add mallocs **/
     
    11881189            strcpy(bkpinfo->media_device, "/dev/cdrom");    /* superfluous */
    11891190            bkpinfo->isodir[0] = iso_mnt[0] = iso_path[0] = '\0';
    1190             if (mount_cdrom(bkpinfo)) {
     1191            if (mount_cdrom()) {
    11911192                fatal_error
    11921193                    ("Unable to mount isodir. Failed to mount CD-ROM as well.");
     
    12091210        log_msg(2,
    12101211                "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    1211         interactively_obtain_media_parameters_from_user(bkpinfo,
    1212                                                         FALSE);
     1212        interactively_obtain_media_parameters_from_user(FALSE);
    12131213        media_specified_by_user = bkpinfo->backup_media_type;
    1214         get_cfg_file_from_archive(bkpinfo);
     1214        get_cfg_file_from_archive();
    12151215/*
    12161216      if (media_specified_by_user != cdr && media_specified_by_user == cdrw)
     
    12501250*/
    12511251struct
    1252 s_node *process_filelist_and_biggielist(struct s_bkpinfo *bkpinfo)
     1252s_node *process_filelist_and_biggielist()
    12531253{
    12541254struct s_node *filelist;
     
    12931293            "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    12941294            bkpinfo->isodir);
    1295     insist_on_this_cd_number(bkpinfo, 1);
     1295    insist_on_this_cd_number(1);
    12961296    log_msg(2, "Back from iotcn");
    12971297    run_program_and_log_output("mount", 1);
     
    19891989 * - @c bkpinfo->disaster_recovery
    19901990 */
    1991 void setup_MR_global_filenames(struct s_bkpinfo *bkpinfo)
     1991void setup_MR_global_filenames()
    19921992{
    19931993    char *temppath;
     
    22922292 * @return 0 for success, nonzero for failure.
    22932293 */
    2294 int get_cfg_file_from_archive(struct s_bkpinfo *bkpinfo)
     2294int get_cfg_file_from_archive()
    22952295{
    22962296    int retval = 0;
     
    23792379                    "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    23802380        }
    2381         if (extract_config_file_from_ramdisk
    2382             (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) {
     2381        if (extract_config_file_from_ramdisk(ramdisk_fname, cfg_file, mountlist_file)) {
    23832382            log_msg(2,
    23842383                    "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
     
    23942393        } else {
    23952394            log_msg(2, "gcffa --- calling mount_cdrom now :)");
    2396             if (!mount_cdrom(bkpinfo)) {
     2395            if (!mount_cdrom()) {
    23972396                log_msg(2,
    23982397                        "gcffa --- managed to mount CD; so, no need for Plan B");
     
    24012400                try_plan_B = TRUE;
    24022401            }
    2403             if (what_number_cd_is_this(bkpinfo) > 1) {
    2404                 insist_on_this_cd_number(bkpinfo,
    2405                                          (g_current_media_number = 1));
     2402            if (what_number_cd_is_this() > 1) {
     2403                insist_on_this_cd_number((g_current_media_number = 1));
    24062404            }
    24072405        }
Note: See TracChangeset for help on using the changeset viewer.