Changeset 783 in MondoRescue for trunk/mondo/mondo/mondoarchive/main.c


Ignore:
Timestamp:
Aug 31, 2006, 5:09:20 PM (18 years ago)
Author:
Bruno Cornec
Message:
  • Massive rewrite continues for memory management.
  • main structure should now have all parameters allocated dynamically
  • new lib libmr.a + dir + build process reviewed to support it.
  • new include subdir to host external definitions of the new lib
  • code now compiles. Still one remaining link issues for mondorestore. This should allow for some tests soon.

(goal is to separate completely reviewed code and functions and provide clean interfaces)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondoarchive/main.c

    r688 r783  
    1717#include <stdio.h>
    1818#include <stdlib.h>
    19 #include "../common/my-stuff.h"
     19#include "my-stuff.h"
    2020#include "../common/mondostructures.h"
    2121#include "../common/libmondo.h"
     
    3333extern bool g_remount_cdrom_at_end, g_remount_floppy_at_end;
    3434extern char *g_mondo_home;
    35 extern char *g_tmpfs_mountpt;
    3635extern char *g_erase_tmpdir_and_scratchdir;
    3736extern double g_kernel_version;
     
    4140long diffs;
    4241
    43 extern t_bkptype g_backup_media_type;
    4442extern int g_loglevel;
    4543
    4644/****************** subroutines used only by main.c ******************/
    4745
     46extern void mr_archive_init_conf(struct s_mr_conf *mr_conf);
    4847
    4948/**
     
    131130{
    132131    struct s_bkpinfo *bkpinfo;
    133     struct s_mrconf *mrconf;
    134132    char *tmp;
    135133    int res = 0;
     
    147145    }
    148146
    149 /* If -V, -v or --version then echo version no. and quit */
     147    /* If -V, -v or --version then echo version no. and quit */
    150148    if (argc == 2
    151149        && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V")
     
    155153    }
    156154
    157 /* Initialize variables */
    158 
     155    /* Initialize variables */
    159156    malloc_libmondo_global_strings();
    160 
    161     /* Initialize Configuration Structure */
    162     mrarchive_init_conf(mrconf);
    163157
    164158    res = 0;
     
    170164    }
    171165
    172 
    173 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     166    /* Initialize Configuration Structure */
     167    mr_archive_init_conf(bkpinfo->mr_conf);
     168
     169
     170    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
    174171    asprintf(&tmp, "/sbin:/usr/sbin:%s:/usr/local/sbin", getenv("PATH"));
    175172    setenv("PATH", tmp, 1);
    176173    paranoid_free(tmp);
    177174
    178 /* Add the ARCH environment variable for ia64 purposes */
     175    /* Add the ARCH environment variable for ia64 purposes */
    179176    setenv("ARCH", get_architecture(), 1);
    180177
     
    331328    /* If we're meant to backup then backup */
    332329    if (bkpinfo->backup_data) {
    333         res = backup_data(bkpinfo, mrconf);
     330        res = backup_data(bkpinfo);
    334331        retval += res;
    335332        if (res) {
Note: See TracChangeset for help on using the changeset viewer.