Ignore:
Timestamp:
Nov 10, 2012, 5:05:37 AM (11 years ago)
Author:
Bruno Cornec
Message:

r5035@localhost: bruno | 2012-11-09 03:17:01 +0100

  • Fix a compilation error and most compilation warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondorestore/mondorestore.c

    r3056 r3060  
    767767    int retval = 0;
    768768    int res = 0;
    769     bool boot_loader_installed = FALSE;
    770769  /** malloc **/
    771770    char tmp[MAX_STR_LEN];
     
    846845                log_to_screen("Preparing to format your disk(s)");
    847846                sleep(1);
    848                 system("sync");
     847                paranoid_system("sync");
    849848                log_to_screen("Please wait. This may take a few minutes.");
    850849                res += format_everything(mountlist, FALSE, raidlist);
     
    881880        log_msg(1,
    882881                "Great! Boot loader was installed. No need for msg at end.");
    883         boot_loader_installed = TRUE;
    884882    }
    885883    clean_blkid();
     
    919917    }
    920918    g_I_have_just_nuked = TRUE;
    921 /*
    922   if (!boot_loader_installed && !does_file_exist(DO_MBR_PLEASE))
    923     {
    924       log_to_screen("PLEASE RUN 'mondorestore --mbr' NOW TO INITIALIZE YOUR BOOT SECTOR");
    925       write_one_liner_data_file(DO_MBR_PLEASE, "mondorestore --mbr");
    926     }
    927 */
    928919    return (retval);
    929920}
     
    10631054        *ntfsprog_command, *suffix, *sz_devfile;
    10641055    char *bigblk;
    1065     char *p;
    10661056    char *mds = NULL;
    10671057    int retval = 0;
     
    11161106                bigfileno + 1);
    11171107        log_msg(3, tmp);
    1118         p = checksum;
    11191108    }
    11201109
     
    13441333
    13451334    if (strcmp(outfile_fname, "/dev/null")) {
    1346         chown(outfile_fname, biggiestruct.properties.st_uid,
    1347               biggiestruct.properties.st_gid);
     1335        if (chown(outfile_fname, biggiestruct.properties.st_uid,
     1336              biggiestruct.properties.st_gid)) {
     1337            // FIXME
     1338        }
    13481339        chmod(outfile_fname, biggiestruct.properties.st_mode);
    13491340        ubuf->actime = biggiestruct.properties.st_atime;
     
    16151606    if (strcmp(outfile_fname, "/dev/null")) {
    16161607        chmod(outfile_fname, biggiestruct.properties.st_mode);
    1617         chown(outfile_fname, biggiestruct.properties.st_uid,
    1618               biggiestruct.properties.st_gid);
     1608        if (chown(outfile_fname, biggiestruct.properties.st_uid,
     1609              biggiestruct.properties.st_gid)) {
     1610            // FIXME
     1611        }
    16191612        ubuf->actime = biggiestruct.properties.st_atime;
    16201613        ubuf->modtime = biggiestruct.properties.st_mtime;
     
    18311824        if (retval) {
    18321825            mr_asprintf(&command, "cat %s >> %s", temp_log, MONDO_LOGFILE);
    1833             system(command);
     1826            paranoid_system(command);
    18341827            paranoid_free(command);
    18351828
     
    25802573    max_val = atol(tmp) + 1;
    25812574
    2582     chdir(bkpinfo->restore_path);   /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */
     2575    if (chdir(bkpinfo->restore_path)) { /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */
     2576        //FIXME
     2577    }
    25832578
    25842579    run_program_and_log_output("pwd", 5);
     
    27082703    log_msg(2, "restore_everything() --- starting");
    27092704    g_current_media_number = 1;
    2710     getcwd(cwd, MAX_STR_LEN - 1);
     2705    if (getcwd(cwd, MAX_STR_LEN - 1)) {
     2706        // FIXME
     2707    }
    27112708    sprintf(tmp, "mkdir -p %s", bkpinfo->restore_path);
    27122709    run_program_and_log_output(tmp, FALSE);
    27132710    log_msg(1, "Changing dir to %s", bkpinfo->restore_path);
    2714     chdir(bkpinfo->restore_path);
    2715     getcwd(newpath, MAX_STR_LEN - 1);
     2711    if (chdir(bkpinfo->restore_path)) {
     2712        //FIXME
     2713    }
     2714    if (getcwd(newpath, MAX_STR_LEN - 1)) {
     2715        // FIXME
     2716    }
    27162717    log_msg(1, "path is now %s", newpath);
    27172718    log_msg(1, "restoring everything");
     
    27452746        resB = restore_all_biggiefiles_from_CD(filelist);
    27462747    }
    2747     chdir(cwd);
     2748    if (chdir(cwd)) {
     2749        //FIXME
     2750    }
    27482751    if (resA + resB) {
    27492752        log_to_screen("Errors occurred while data was being restored.");
     
    29362939    if (argc == 2 && strcmp(argv[1], "--edit-mountlist") == 0) {
    29372940#ifdef __FreeBSD__
    2938         system("mv -f /tmp/raidconf.txt /etc/raidtab");
     2941        paranoid_system("mv -f /tmp/raidconf.txt /etc/raidtab");
    29392942        if (!does_file_exist("/etc/raidtab"))
    2940             system("vinum printconfig > /etc/raidtab");
     2943            paranoid_system("vinum printconfig > /etc/raidtab");
    29412944#endif
    29422945        load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
     
    29462949        res = let_user_edit_the_mountlist(mountlist, raidlist);
    29472950#ifdef __FreeBSD__
    2948         system("mv -f /etc/raidtab /tmp/raidconf.txt");
     2951        paranoid_system("mv -f /etc/raidtab /tmp/raidconf.txt");
    29492952#endif
    29502953        paranoid_MR_finish(res);
     
    29592962    if (argc >= 2 && strcmp(argv[1], "--pih") == 0) {
    29602963        if (system("mount | grep cdrom 2> /dev/null > /dev/null")) {
    2961             system("mount " MNT_CDROM);
     2964            paranoid_system("mount " MNT_CDROM);
    29622965        }
    29632966        bkpinfo->compression_level = 1;
     
    29692972                           "Please wait. This may take some time.",
    29702973                           "", 1999);
    2971         system("rm -Rf /tmp/*pih*");
     2974        paranoid_system("rm -Rf /tmp/*pih*");
    29722975
    29732976        restore_a_biggiefile_from_CD(42, NULL, tmp);
     
    32693272    if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) {
    32703273        sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir);
    3271         system(tmp);
     3274        paranoid_system(tmp);
    32723275    }
    32733276    paranoid_MR_finish(retval); // frees global stuff plus bkpinfo
Note: See TracChangeset for help on using the changeset viewer.