Changeset 2202 in MondoRescue
- Timestamp:
- May 13, 2009, 4:34:00 AM (16 years ago)
- Location:
- branches/2.2.9/mondo
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/Makefile.am
r899 r2202 1 1 AUTOMAKE_OPTIONS = 1.7 2 SUBDIRS = src 2 SUBDIRS = src test 3 3 man8_MANS = docs/man/mondoarchive.8 docs/man/mondorestore.8 -
branches/2.2.9/mondo/configure.in
r2195 r2202 125 125 AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr mkdtemp]) 126 126 127 AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile ])127 AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile test/Makefile]) -
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2190 r2202 803 803 } 804 804 if (bkpinfo->backup_media_type == usb) { 805 asprintf(&tmp2, "--usb %s", bkpinfo->media_device);805 (void)asprintf(&tmp2, "--usb %s", bkpinfo->media_device); 806 806 } else { 807 asprintf(&tmp2," ");807 (void)asprintf(&tmp2," "); 808 808 } 809 809 … … 828 828 829 829 if (g_getfattr) { 830 asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);830 (void)asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir); 831 831 if (write_one_liner_data_file(tmp1, "TRUE")) { 832 832 log_msg(1, "%ld: Unable to write one-liner XATTR", … … 836 836 } 837 837 if (g_getfacl) { 838 asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);838 (void)asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir); 839 839 if (write_one_liner_data_file(tmp1, "TRUE")) { 840 840 log_msg(1, "%ld: Unable to write one-liner ACL", … … 844 844 } 845 845 if (bkpinfo->use_obdr) { 846 asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir);846 (void)asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir); 847 847 if (write_one_liner_data_file(tmp1, "TRUE")) { 848 848 log_msg(1, "%ld: Unable to write one-liner OBDR", … … 1581 1581 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1582 1582 (void) getcwd(old_pwd, MAX_STR_LEN - 1); 1583 asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir);1583 (void)asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir); 1584 1584 run_program_and_log_output(tmp, FALSE); 1585 1585 paranoid_free(tmp); 1586 chdir(bkpinfo->scratchdir);1587 1588 asprintf(&message_to_screen, "Copying data to make %s #%d",1586 (void)chdir(bkpinfo->scratchdir); 1587 1588 (void)asprintf(&message_to_screen, "Copying data to make %s #%d", 1589 1589 media_descriptor_string(bkpinfo->backup_media_type), 1590 1590 g_current_media_number); 1591 1591 log_msg(1, message_to_screen); 1592 1592 1593 asprintf(&tmp1, "%s1", bkpinfo->media_device);1593 (void)asprintf(&tmp1, "%s1", bkpinfo->media_device); 1594 1594 if (is_this_device_mounted(tmp1)) { 1595 1595 log_msg(1, "USB device mounted. Remounting it at the right place"); 1596 asprintf(&tmp, "umount %s", tmp1);1596 (void)asprintf(&tmp, "umount %s", tmp1); 1597 1597 run_program_and_log_output(tmp, FALSE); 1598 1598 paranoid_free(tmp); … … 1601 1601 1602 1602 log_msg(1, "Mounting USB device."); 1603 asprintf(&tmp1, "%s/usb", bkpinfo->tmpdir);1604 asprintf(&tmp, "mkdir -p %s", tmp1);1603 (void)asprintf(&tmp1, "%s/usb", bkpinfo->tmpdir); 1604 (void)asprintf(&tmp, "mkdir -p %s", tmp1); 1605 1605 run_program_and_log_output(tmp, FALSE); 1606 1606 paranoid_free(tmp); 1607 1607 /* Mindi always create one single parition on the USB dev */ 1608 asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, tmp1);1608 (void)asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, tmp1); 1609 1609 run_program_and_log_output(tmp, FALSE); 1610 1610 paranoid_free(tmp); … … 1616 1616 1617 1617 /* Command to execute */ 1618 asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1);1618 (void)asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1); 1619 1619 res = eval_call_to_make_USB(tmp, message_to_screen); 1620 1620 if (res) { 1621 asprintf(&result_sz, "%s ...failed",tmp);1621 (void)asprintf(&result_sz, "%s ...failed",tmp); 1622 1622 } else { 1623 asprintf(&result_sz, "%s ...OK",tmp);1623 (void)asprintf(&result_sz, "%s ...OK",tmp); 1624 1624 } 1625 1625 log_to_screen(result_sz); … … 1632 1632 1633 1633 if (is_this_device_mounted(bkpinfo->media_device)) { 1634 asprintf(&tmp, "umount %s1", bkpinfo->media_device);1634 (void)asprintf(&tmp, "umount %s1", bkpinfo->media_device); 1635 1635 run_program_and_log_output(tmp, FALSE); 1636 1636 paranoid_free(tmp); 1637 1637 } 1638 1638 1639 chdir(old_pwd);1639 (void)chdir(old_pwd); 1640 1640 if (retval) { 1641 1641 log_msg(1, "WARNING - make_usb_fs returned an error"); … … 1769 1769 ("Failed to write to disk. I shall blank it and then try again."); 1770 1770 sleep(5); 1771 system("sync");1771 (void)system("sync"); 1772 1772 pause_for_N_seconds(5, "Letting DVD drive settle"); 1773 1773 … … 2398 2398 } 2399 2399 2400 asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,2400 (void)asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir, 2401 2401 biggielist); 2402 2402 paranoid_system(command); 2403 2403 paranoid_free(command); 2404 2404 2405 asprintf(&blah, "biggielist = %s", biggielist);2405 (void)asprintf(&blah, "biggielist = %s", biggielist); 2406 2406 log_msg(2, blah); 2407 2407 paranoid_free(blah); … … 2413 2413 if (g_getfattr) { 2414 2414 get_fattr_list(biggielist, xattr_fname); 2415 asprintf(&command, "cp %s %s/archives/", xattr_fname,2415 (void)asprintf(&command, "cp %s %s/archives/", xattr_fname, 2416 2416 bkpinfo->scratchdir); 2417 2417 paranoid_system(command); … … 2420 2420 if (g_getfacl) { 2421 2421 get_acl_list(biggielist, acl_fname); 2422 asprintf(&command, "cp %s %s/archives/", acl_fname,2422 (void)asprintf(&command, "cp %s %s/archives/", acl_fname, 2423 2423 bkpinfo->scratchdir); 2424 2424 paranoid_system(command); … … 2428 2428 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2429 2429 res += write_EXAT_files_to_tape(xattr_fname, acl_fname); 2430 asprintf(&blah, "%ld", count_lines_in_file(biggielist));2430 (void)asprintf(&blah, "%ld", count_lines_in_file(biggielist)); 2431 2431 write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES); 2432 2432 paranoid_free(blah); … … 3555 3555 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 3556 3556 MONDO_LOGFILE, MONDO_CACHE); 3557 system(tmp);3557 (void)system(tmp); 3558 3558 3559 3559 sprintf(tmp, 3560 3560 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 3561 3561 MONDO_LOGFILE, MONDO_CACHE); 3562 system(tmp);3562 (void)system(tmp); 3563 3563 run_program_and_log_output("umount " MNT_CDROM, FALSE); 3564 3564 // if (bkpinfo->backup_media_type != iso && !bkpinfo->please_dont_eject_when_restoring) -
branches/2.2.9/mondo/src/common/libmondo-cli.c
r2190 r2202 1444 1444 /*@ ints ** */ 1445 1445 int opt = 0; 1446 char tmp[MAX_STR_LEN];1446 char *tmp = NULL; 1447 1447 int i = 0; 1448 1448 int len; … … 1467 1467 if (flag_set[optopt]) { 1468 1468 bad_switches = TRUE; 1469 sprintf(tmp, "Switch -%c previously defined as %s\n", opt,1469 (void) asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, 1470 1470 flag_val[i]); 1471 1471 log_to_screen(tmp); 1472 paranoid_free(tmp); 1472 1473 } else { 1473 1474 flag_set[opt] = TRUE; … … 1483 1484 if (strchr(flag_val[opt], '/') 1484 1485 && flag_val[opt][0] != '/') { 1485 sprintf(tmp,1486 (void)asprintf(&tmp, 1486 1487 "-%c flag --- must be absolute path --- '%s' isn't absolute", 1487 1488 opt, flag_val[opt]); 1488 1489 log_to_screen(tmp); 1490 paranoid_free(tmp); 1489 1491 bad_switches = TRUE; 1490 1492 } … … 1497 1499 for (i = optind; i < argc; i++) { 1498 1500 bad_switches = TRUE; 1499 sprintf(tmp, "Invalid arg -- %s\n", argv[i]);1501 (void)asprintf(&tmp, "Invalid arg -- %s\n", argv[i]); 1500 1502 log_to_screen(tmp); 1503 paranoid_free(tmp); 1501 1504 } 1502 1505 return (bad_switches); -
branches/2.2.9/mondo/src/common/libmondo-devices.c
r2190 r2202 664 664 return (1); 665 665 } 666 for ( fgets(tmp, MAX_STR_LEN, fin); !feof(fin);667 fgets(tmp, MAX_STR_LEN, fin)) {666 for ((void)fgets(tmp, MAX_STR_LEN, fin); !feof(fin); 667 (void)fgets(tmp, MAX_STR_LEN, fin)) { 668 668 p = strchr(tmp, '\''); 669 669 if (p) { … … 698 698 log_msg(4, "Cannot run 2nd command - non-fatal, fortunately"); 699 699 } else { 700 for ( fgets(tmp, MAX_STR_LEN, fin); !feof(fin);701 fgets(tmp, MAX_STR_LEN, fin)) {700 for ((void)fgets(tmp, MAX_STR_LEN, fin); !feof(fin); 701 (void)fgets(tmp, MAX_STR_LEN, fin)) { 702 702 log_msg(5, "--> '%s'", tmp); 703 703 if (tmp[0] != ' ' && tmp[1] != ' ') { … … 1141 1141 return (FALSE); 1142 1142 } 1143 for ( fgets(incoming, MAX_STR_LEN - 1, fin); !feof(fin);1144 fgets(incoming, MAX_STR_LEN - 1, fin)) {1143 for ((void)fgets(incoming, MAX_STR_LEN - 1, fin); !feof(fin); 1144 (void)fgets(incoming, MAX_STR_LEN - 1, fin)) { 1145 1145 if (strstr(incoming, device_with_space) //> incoming 1146 1146 || strstr(incoming, device_with_tab)) // > incoming) … … 1399 1399 } 1400 1400 sprintf(tmp, "mkdir -p %s/isodir &> /dev/null", bkpinfo->tmpdir); 1401 system(tmp);1401 (void)system(tmp); 1402 1402 sprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, 1403 1403 bkpinfo->nfs_remote_dir, bkpinfo->prefix, … … 1813 1813 if (bkpinfo->disaster_recovery) { 1814 1814 sprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir); 1815 system(command);1815 (void)system(command); 1816 1816 if (!popup_and_get_string 1817 1817 ("NFS share", "Which remote NFS share should I mount?", … … 2452 2452 return ('\0'); 2453 2453 } 2454 for ( fgets(current_drive, MAX_STR_LEN, pdrives); !feof(pdrives);2455 fgets(current_drive, MAX_STR_LEN, pdrives)) {2454 for ((void)fgets(current_drive, MAX_STR_LEN, pdrives); !feof(pdrives); 2455 (void)fgets(current_drive, MAX_STR_LEN, pdrives)) { 2456 2456 strip_spaces(current_drive); 2457 2457 log_it("looking at drive %s's MBR", current_drive); … … 2490 2490 return ('\0'); 2491 2491 } 2492 for ( fgets(current_drive, MAX_STR_LEN, pdrives); !feof(pdrives);2493 fgets(current_drive, MAX_STR_LEN, pdrives)) {2492 for ((void)fgets(current_drive, MAX_STR_LEN, pdrives); !feof(pdrives); 2493 (void)fgets(current_drive, MAX_STR_LEN, pdrives)) { 2494 2494 strip_spaces(current_drive); 2495 2495 log_it("looking at partition %s's BR", current_drive); -
branches/2.2.9/mondo/src/common/libmondo-filelist.c
r2201 r2202 440 440 } 441 441 malloc_string(tmp); 442 for ( fgets(tmp, MAX_STR_LEN, pattr); !feof(pattr);443 fgets(tmp, MAX_STR_LEN, pattr)) {442 for ((void)fgets(tmp, MAX_STR_LEN, pattr); !feof(pattr); 443 (void)fgets(tmp, MAX_STR_LEN, pattr)) { 444 444 fputs(tmp, pout); 445 445 } … … 476 476 } 477 477 malloc_string(file_to_analyze); 478 for ( fgets(file_to_analyze, MAX_STR_LEN, fin); !feof(fin);479 fgets(file_to_analyze, MAX_STR_LEN, fin)) {478 for ((void)fgets(file_to_analyze, MAX_STR_LEN, fin); !feof(fin); 479 (void)fgets(file_to_analyze, MAX_STR_LEN, fin)) { 480 480 i = strlen(file_to_analyze); 481 481 if (i > 0 && file_to_analyze[i - 1] < 32) { … … 484 484 log_msg(8, "Analyzing %s", file_to_analyze); 485 485 tmp = mr_stresc(file_to_analyze, "`$\\\"()\'|", '\\'); 486 asprintf(&strtmp, syscall_sprintf, tmp);486 (void)asprintf(&strtmp, syscall_sprintf, tmp); 487 487 paranoid_free(tmp); 488 asprintf(&syscall, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE);488 (void)asprintf(&syscall, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE); 489 489 paranoid_free(strtmp); 490 490 call_exe_and_pipe_output_to_fd(syscall, pout); … … 609 609 // printf("Hi there. Starting the loop\n"); 610 610 611 fgets(current_subset_file, MAX_STR_LEN, faclin);612 fgets(incoming, MAX_STR_LEN, pin);611 (void)fgets(current_subset_file, MAX_STR_LEN, faclin); 612 (void)fgets(incoming, MAX_STR_LEN, pin); 613 613 while (!feof(pin) && !feof(faclin)) { 614 614 // printf("incoming = %s", incoming); … … 642 642 if (i < 0) { // read another subset file in. 643 643 log_msg(my_depth, "Reading next subset line in\n\n"); 644 fgets(current_subset_file, MAX_STR_LEN, faclin);644 (void)fgets(current_subset_file, MAX_STR_LEN, faclin); 645 645 continue; 646 646 } … … 649 649 fputs(incoming, pout); 650 650 } 651 fgets(incoming, MAX_STR_LEN, pin);651 (void)fgets(incoming, MAX_STR_LEN, pin); 652 652 if (!i) { 653 653 log_msg(my_depth, "Copying master %s", q); … … 662 662 fputs(incoming, pout); 663 663 } 664 fgets(incoming, MAX_STR_LEN, pin);664 (void)fgets(incoming, MAX_STR_LEN, pin); 665 665 } 666 666 if (!i) { 667 fgets(current_subset_file, MAX_STR_LEN, faclin);667 (void)fgets(current_subset_file, MAX_STR_LEN, faclin); 668 668 } 669 669 } 670 670 while (!feof(pin)) { 671 fgets(incoming, MAX_STR_LEN, pin);671 (void)fgets(incoming, MAX_STR_LEN, pin); 672 672 } 673 673 fclose(faclin); … … 916 916 } 917 917 open_evalcall_form("Loading filelist from disk"); 918 for ( fgets(fname, MAX_STR_LEN, pin); !feof(pin);919 fgets(fname, MAX_STR_LEN, pin)) {918 for ((void)fgets(fname, MAX_STR_LEN, pin); !feof(pin); 919 (void)fgets(fname, MAX_STR_LEN, pin)) { 920 920 if ((fname[strlen(fname) - 1] == 13 921 921 || fname[strlen(fname) - 1] == 10) && strlen(fname) > 0) { … … 1389 1389 malloc_string(name_of_evalcall_form); 1390 1390 malloc_string(find_skeleton_marker); 1391 asprintf(&find_excludes, " ");1391 (void)asprintf(&find_excludes, " "); 1392 1392 while((token = mr_strtok (sth, delims, &lastpos))) { 1393 asprintf(&strtmp,"%s", find_excludes);1393 (void)asprintf(&strtmp,"%s", find_excludes); 1394 1394 paranoid_free(find_excludes); 1395 asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);1395 (void)asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token); 1396 1396 paranoid_free(strtmp); 1397 1397 paranoid_free(token); … … 1399 1399 #if linux 1400 1400 // 2.6 has /sys as a proc-type thing -- must be excluded 1401 asprintf(&strtmp,1401 (void)asprintf(&strtmp, 1402 1402 "find '%s' -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype proc -prune -o -fstype sysfs -prune -o %s -type d -print > %s 2> /dev/null", 1403 1403 dir, find_excludes, g_skeleton_filelist); 1404 1404 #else 1405 1405 // On BSD, for example, /sys is the kernel sources -- don't exclude 1406 asprintf(&strtmp,1406 (void)asprintf(&strtmp, 1407 1407 "find '%s' -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null", 1408 1408 dir, find_excludes, g_skeleton_filelist); … … 1410 1410 paranoid_free(find_excludes); 1411 1411 log_msg(5, "find command = %s", strtmp); 1412 system(strtmp);1412 (void)system(strtmp); 1413 1413 paranoid_free(strtmp); 1414 asprintf(&tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist);1414 (void)asprintf(&tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist); 1415 1415 g_skeleton_entries = 1416 1416 1 + atol(call_program_and_get_last_line_of_output(tmp)); … … 1442 1442 #ifndef _XWIN 1443 1443 if (!g_text_mode) { 1444 asprintf(&tmp, "Reading %-68s", dir);1444 (void)asprintf(&tmp, "Reading %-68s", dir); 1445 1445 newtDrawRootText(0, g_noof_rows - 3, tmp); 1446 1446 paranoid_free(tmp); … … 1456 1456 // log_msg(0, "Cataloguing %s", dir); 1457 1457 if (sth[0] == ' ') { 1458 asprintf(&skip_these, "%s", sth);1458 (void)asprintf(&skip_these, "%s", sth); 1459 1459 } else { 1460 asprintf(&skip_these, " %s ", sth);1461 } 1462 asprintf(&new_with_spaces, " %s ", dir);1460 (void)asprintf(&skip_these, " %s ", sth); 1461 } 1462 (void)asprintf(&new_with_spaces, " %s ", dir); 1463 1463 if ((dip = opendir(dir)) == NULL) { 1464 asprintf(&tmp,"opendir %s", dir);1464 (void)asprintf(&tmp,"opendir %s", dir); 1465 1465 log_OS_error(tmp); 1466 1466 paranoid_free(tmp); … … 1472 1472 i++; 1473 1473 if (strcmp(dir, "/")) { 1474 asprintf(&new,"%s/%s",dir,dit->d_name);1474 (void)asprintf(&new,"%s/%s",dir,dit->d_name); 1475 1475 } else { 1476 asprintf(&new,"%s%s",dir,dit->d_name);1476 (void)asprintf(&new,"%s%s",dir,dit->d_name); 1477 1477 } 1478 1478 paranoid_free(new_with_spaces); 1479 asprintf(&new_with_spaces, " %s ", new);1479 (void)asprintf(&new_with_spaces, " %s ", new); 1480 1480 if (strstr(skip_these, new_with_spaces)) { 1481 1481 fprintf(fout, "%s\n", new); … … 1496 1496 counter = 0; 1497 1497 uberctr++; 1498 asprintf(&tmp, " %c ",1498 (void)asprintf(&tmp, " %c ", 1499 1499 special_dot_char(uberctr)); 1500 1500 #ifndef _XWIN … … 1550 1550 bool in_quotes = FALSE; 1551 1551 1552 asprintf(&sz_res, "%s", incoming);1552 (void)asprintf(&sz_res, "%s", incoming); 1553 1553 p = sz_res; 1554 1554 while ((*p != ' ' || in_quotes) && *p != '\0') { … … 1598 1598 fatal_error("Cannot malloc exclude_paths"); 1599 1599 } 1600 asprintf(&sz_datefile,MONDO_CACHE"/difflevel.%d" , 0);1600 (void)asprintf(&sz_datefile,MONDO_CACHE"/difflevel.%d" , 0); 1601 1601 if (!include_paths && !userdef_filelist) { 1602 1602 fatal_error … … 1606 1606 sprintf(command, "mkdir -p %s/archives", scratchdir); 1607 1607 paranoid_system(command); 1608 asprintf(&sz_filelist, "%s/tmpfs/filelist.full", tmpdir);1608 (void)asprintf(&sz_filelist, "%s/tmpfs/filelist.full", tmpdir); 1609 1609 make_hole_for_file(sz_filelist); 1610 1610 … … 1646 1646 log_msg(2, "include_paths = '%s'", include_paths); 1647 1647 log_msg(1, "Calculating filelist"); 1648 asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'"));1648 (void)asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'")); 1649 1649 if (strlen(tmp2) < 1) { 1650 asprintf(&tmp1," ");1650 (void)asprintf(&tmp1," "); 1651 1651 } else { 1652 1652 log_msg(2, "Found windows FS: %s",tmp2); 1653 asprintf(&tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2);1653 (void)asprintf(&tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2); 1654 1654 paranoid_free(tmp2); 1655 asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output(tmp1));1655 (void)asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output(tmp1)); 1656 1656 log_msg(2, "Found windows files: %s",tmp2); 1657 1657 } … … 1813 1813 // fscanf(fin, "%s\n", fname); 1814 1814 len = MAX_STR_LEN - 1; 1815 getline(&fname, &len, fin); // patch by Scrub1815 (void)getline(&fname, &len, fin); // patch by Scrub 1816 1816 if (!use_star) { 1817 1817 if (fname[0] == '/') { … … 1883 1883 return (1); 1884 1884 } 1885 for ( fgets(tmp, MAX_STR_LEN, fin); !feof(fin);1886 fgets(tmp, MAX_STR_LEN, fin)) {1885 for ((void)fgets(tmp, MAX_STR_LEN, fin); !feof(fin); 1886 (void)fgets(tmp, MAX_STR_LEN, fin)) { 1887 1887 if (!tmp[0]) { 1888 1888 continue; -
branches/2.2.9/mondo/src/common/libmondo-mountlist-EXT.h
r1295 r2202 8 8 extern int look_for_duplicate_mountpoints(struct mountlist_itself 9 9 *mountlist, char *flaws_str); 10 extern int look_for_weird_formats(struct mountlist_itself *mountlist,11 char *flaws_str);12 10 extern int make_list_of_drives_in_mountlist(struct mountlist_itself *, 13 11 struct list_of_disks *); -
branches/2.2.9/mondo/src/common/libmondo-mountlist.c
r2125 r2202 508 508 /*@ buffer *********************************************************** */ 509 509 struct list_of_disks *drivelist; 510 char *tmp ;511 char *flaws_str ;510 char *tmp = NULL; 511 char *flaws_str = NULL; 512 512 513 513 /*@ int ************************************************************** */ … … 547 547 } 548 548 res += look_for_duplicate_mountpoints(mountlist, flaws_str); 549 /* res+=look_for_weird_formats(mountlist,flaws_str); .. not necessary, now that we can check to see550 which formarts are actually _supported_ by the kernel */551 /* log_it(flaws_str); */552 549 return (spread_flaws_across_three_lines 553 550 (flaws_str, flaws_str_A, flaws_str_B, flaws_str_C, res)); … … 644 641 return (res); 645 642 } 646 647 /**648 * Look for strange formats. Does not respect /proc/filesystems.649 * @param mountlist The mountlist to check.650 * @param flaws_str The flaws string to append the results to.651 * @return The number of weird formats found, or 0 for success.652 * @bug Seems orphaned; please remove.653 */654 int655 look_for_weird_formats(struct mountlist_itself *mountlist, char *flaws_str)656 {657 658 /*@ int ************************************************************* */659 int i = 0;660 int res = 0;661 662 /*@ buffers ********************************************************* */663 char *tmp;664 char *format_sz;665 666 malloc_string(tmp);667 malloc_string(format_sz);668 669 assert(mountlist != NULL);670 assert(flaws_str != NULL);671 672 for (i = 0; i < mountlist->entries; i++) {673 sprintf(format_sz, " %s ", mountlist->el[i].format);674 if (!strstr(SANE_FORMATS, format_sz)675 && strcmp(mountlist->el[i].mountpoint, "image") != 0) {676 sprintf(tmp, " %s has unknown format.",677 mountlist->el[i].device);678 log_it(tmp);679 strcat(flaws_str, tmp);680 res++;681 } else if ((!strcmp(mountlist->el[i].format, "swap")682 && strcmp(mountlist->el[i].mountpoint, "swap")683 && strcmp(mountlist->el[i].mountpoint, "none"))684 || (strcmp(mountlist->el[i].format, "swap")685 && !strcmp(mountlist->el[i].mountpoint, "swap")686 && !strcmp(mountlist->el[i].mountpoint, "none"))) {687 sprintf(tmp, " %s is half-swap.", mountlist->el[i].device);688 log_it(tmp);689 strcat(flaws_str, tmp);690 res++;691 }692 }693 paranoid_free(tmp);694 paranoid_free(format_sz);695 return (res);696 }697 698 643 699 644 -
branches/2.2.9/mondo/src/common/libmondo-mountlist.h
r1295 r2202 11 11 int look_for_duplicate_mountpoints(struct mountlist_itself *mountlist, 12 12 char *flaws_str); 13 int look_for_weird_formats(struct mountlist_itself *mountlist,14 char *flaws_str);15 13 int make_list_of_drives_in_mountlist(struct mountlist_itself *, 16 14 struct list_of_disks *); -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.h
r1930 r2202 149 149 void log_to_screen(const char *fmt, ...); 150 150 int look_for_duplicate_mountpoints(struct mountlist_itself *, char *); 151 int look_for_weird_formats(struct mountlist_itself *, char *);152 151 void make_list_of_unallocated_raid_partitions(struct mountlist_itself *, 153 152 struct mountlist_itself *, -
branches/2.2.9/mondo/src/mondorestore/mondorestore.c
r2144 r2202 2880 2880 run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE); 2881 2881 2882 malloc_string(tmp);2883 2882 malloc_string(a); 2884 2883 malloc_string(b); … … 2926 2925 2927 2926 /* Init GUI */ 2928 malloc_libmondo_global_strings();2929 2927 setup_newt_stuff(); /* call newtInit and setup screen log */ 2930 2928 welcome_to_mondorestore(); … … 2955 2953 } 2956 2954 2957 g_loglevel = DEFAULT_MR_LOGLEVEL;2958 2955 if (argc == 3 && strcmp(argv[1], "--echo-to-screen") == 0) { 2959 2956 fout = fopen("/tmp/out.txt", "w");
Note:
See TracChangeset
for help on using the changeset viewer.