- Timestamp:
- Jul 23, 2009, 6:20:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
r2296 r2299 690 690 mr_asprintf(&tmp, "Not formatting %s (it is a RAID disk)", device); 691 691 log_it(tmp); 692 paranoid_free(tmp);692 mr_free(tmp); 693 693 return (0); 694 694 } … … 702 702 mr_asprintf(&tmp, "%s has a really small format type ('%s') - this is probably a hexadecimal string, which would suggest the partition is an image --- I shouldn't format it", device, format); 703 703 log_it(tmp); 704 paranoid_free(tmp);704 mr_free(tmp); 705 705 return (0); 706 706 } … … 708 708 mr_asprintf(&tmp, "%s is mounted - cannot format it ", device); 709 709 log_to_screen(tmp); 710 paranoid_free(tmp);710 mr_free(tmp); 711 711 return (1); 712 712 } … … 738 738 mr_asprintf(&tmp, "Initializing Vinum device %s (this may take a *long* time)", device); 739 739 log_to_screen(tmp); 740 paranoid_free(tmp);740 mr_free(tmp); 741 741 742 742 /* format raid partition */ … … 755 755 mr_asprintf(&tmp, "Initializing plex: %s", line); 756 756 open_evalcall_form(tmp); 757 paranoid_free(tmp);757 mr_free(tmp); 758 758 759 759 mr_asprintf(&tmp, "vinum init %s", line); 760 760 system(tmp); 761 paranoid_free(tmp);761 mr_free(tmp); 762 762 763 763 while (1) { 764 764 mr_asprintf(&tmp, "vinum lp -r %s | grep '^S' | head -1 | tr -s ' ' | cut -d: -f2 | cut -f1 | sed 's/^ //' | sed 's/I //' | sed 's/%%//'", line); 765 765 FILE *pin = popen(tmp, "r"); 766 paranoid_free(tmp);766 mr_free(tmp); 767 767 768 768 char status[MAX_STR_LEN / 4]; … … 780 780 fclose(fin); 781 781 unlink("/tmp/plexes"); 782 /* retval+=res; */783 782 } 784 783 #else 785 784 mr_asprintf(&tmp, "Initializing RAID device %s", device); 786 785 log_to_screen(tmp); 787 paranoid_free(tmp);786 mr_free(tmp); 788 787 789 788 // Shouldn't be necessary. … … 820 819 if (!strcmp(format, "lvm")) { 821 820 log_msg(1, "Don't format %s - it's part of an lvm volume", device); 822 paranoid_free(tmp);823 821 return (0); 824 822 } … … 831 829 832 830 mr_asprintf(&program, "sh -c 'echo -en \"y\\ny\\ny\\n\" | %s'", tmp); 833 paranoid_free(tmp);831 mr_free(tmp); 834 832 835 833 mr_asprintf(&tmp, "Formatting %s as %s", device, format); 836 834 update_progress_form(tmp); 837 paranoid_free(tmp);835 mr_free(tmp); 838 836 839 837 res = run_program_and_log_output(program, FALSE); 840 mr_asprintf(&tmp, ""); 838 if (res) { 839 mr_strcat(tmp, "...failed"); 840 } else { 841 mr_strcat(tmp, "...OK"); 842 } 843 log_to_screen(tmp); 844 mr_free(tmp); 845 841 846 if (res && strstr(program, "kludge")) { 842 mr_strcat(tmp, "Kludge failed; using regular mkfs.%s to format %s", 843 format, device); 847 mr_asprintf(&tmp, "Kludge failed; using regular mkfs.%s to format %s", format, device); 844 848 mr_free(program); 845 849 #ifdef __FreeBSD__ … … 858 862 fprintf(g_fprep, "%s\n", program); 859 863 } 864 if (retval) { 865 mr_strcat(tmp, "...failed"); 866 } else { 867 mr_strcat(tmp, "...OK"); 868 } 869 870 log_to_screen(tmp); 871 mr_free(tmp); 872 860 873 } 861 874 mr_free(program); 862 875 retval += res; 863 if (retval) {864 mr_strcat(tmp, "...failed");865 } else {866 mr_strcat(tmp, "...OK");867 }868 869 log_to_screen(tmp);870 mr_free(tmp);871 872 876 system("sync"); 873 877 sleep(1);
Note:
See TracChangeset
for help on using the changeset viewer.