Ignore:
Timestamp:
Aug 18, 2009, 3:19:15 PM (11 years ago)
Author:
Bruno Cornec
Message:

r3336@localhost: bruno | 2009-08-11 16:32:36 +0200

  • bkpinfo->media_device, bkpinfo->nfs_remote_dir, and bkpinfo->nfs_mount are now dynamically allocated
  • new interfaces for find_cdrom_device(), find_tape_device_and_size(), find_dvd_device(), find_cdrw_device(), set_dev_to_this_if_rx_OK() and read_cfg_var() which allocate the string now returned
  • Better differentiation between ISO and NFS iso file names construction
File:
1 edited

Legend:

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

    r2324 r2325  
    276276    if (argc > 2 && !strcmp(argv[1], "find-cd")) {
    277277        g_loglevel = 10;
    278         malloc_string(tmp);
    279         if (find_cdrw_device(tmp)) {
     278        if ((tmp = find_cdrw_device()) == NULL) {
    280279            printf("Failed to find CDR-RW drive\n");
    281280        } else {
    282281            printf("CD-RW is at %s\n", tmp);
    283282        }
    284         tmp[0] = '\0';
    285         if (find_cdrom_device(tmp, atoi(argv[2]))) {
     283        mr_free(tmp);
     284        if ((tmp = find_cdrom_device(FALSE)) == NULL) {
    286285            printf("Failed to find CD-ROM drive\n");
    287286        } else {
    288287            printf("CD-ROM is at %s\n", tmp);
    289288        }
    290         paranoid_free(tmp);
     289        mr_free(tmp);
    291290        finish(0);
    292291    }
     
    294293    if (argc > 2 && !strcmp(argv[1], "find-dvd")) {
    295294        g_loglevel = 10;
    296         malloc_string(tmp);
    297         if (find_dvd_device(tmp, atoi(argv[2]))) {
     295        if ((tmp = find_dvd_device()) == NULL) {
    298296            printf("Failed to find DVD drive\n");
    299297        } else {
    300298            printf("DVD is at %s\n", tmp);
    301299        }
    302         paranoid_free(tmp);
     300        mr_free(tmp);
    303301        finish(0);
    304302    }
     
    406404    if (bkpinfo->backup_media_type == usb) {
    407405        log_msg(1, "Unmounting USB device.");
     406        if (bkpinfo->media_device == NULL) {
     407            fatal_error("USB device set to NULL");
     408        }
    408409        mr_asprintf(tmp, "umount %s1", bkpinfo->media_device);
    409410        run_program_and_log_output(tmp, TRUE);
Note: See TracChangeset for help on using the changeset viewer.