Ignore:
Timestamp:
Sep 29, 2013, 9:31:34 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Finish with backports from 3.1 for now. Still some work to do, but we will now make that version compile and work again and serve as a base

so the gettext patch can be added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/mondoarchive/mondoarchive.c

    r3148 r3193  
    3737extern t_bkptype g_backup_media_type;
    3838extern int g_loglevel;
     39
    3940extern char *g_magicdev_command;
    4041
     
    101102    log_msg(7, "Seven...");
    102103    log_msg(8, "Eight...");
     104    printf("See %s for details of backup run.\n", MONDO_LOGFILE);
    103105}
    104106
     
    164166    FILE *fin = NULL;
    165167
     168/* Make sure I'm root; abort if not */
     169    if (getuid() != 0) {
     170        fprintf(stderr, "Please run as root.\r\n");
     171        exit(127);
     172    }
     173
     174/* If -V, -v or --version then echo version no. and quit */
     175    if (argc == 2 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") || !strcmp(argv[argc - 1], "--version"))) {
     176        printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
     177        exit(0);
     178    }
     179
     180/* Initialize variables */
     181
    166182    printf("Initializing...\n");
     183
     184    init_bkpinfo();
     185
     186    /* Memory allocation is done in those functions */
     187    malloc_libmondo_global_strings();
    167188
    168189    /* initialize log file with time stamp */
    169190    unlink(MONDO_LOGFILE);
    170     tmp = mr_date();
    171     log_msg(0, "Time started: %s", tmp);
    172     mr_free(tmp);
    173 
    174     init_bkpinfo();
    175 
    176     /* Memory allocation is done in those functions */
    177     malloc_libmondo_global_strings();
     191    log_msg(0, "Time started: %s", mr_date());
     192
    178193    if (argc == 1) {
    179194        g_text_mode = FALSE;
     
    188203    }
    189204    setup_newt_stuff();
    190 
    191     /* Make sure I'm root; abort if not */
    192     if (getuid() != 0) {
    193         fatal_error("Please run as root.\n");
    194     }
    195 
    196     /* If -V, -v or --version then echo version no. and quit */
    197     if (argc == 2 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") || !strcmp(argv[argc - 1], "--version"))) {
    198         printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
    199         finish(0);
    200     }
    201 
    202205
    203206    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     
    449452
    450453    /* finalize log file with time stamp */
    451     tmp = mr_date();
    452     log_msg(0, "Time finished: %s", tmp);
    453     mr_free(tmp);
     454    log_msg(0, "Time finished: %s", mr_date());
    454455
    455456    if (chdir("/tmp")) {
Note: See TracChangeset for help on using the changeset viewer.