Changeset 2352 in MondoRescue for branches/2.2.10/mondo/src/mondorestore
- Timestamp:
- Aug 28, 2009, 2:46:29 AM (16 years ago)
- Location:
- branches/2.2.10/mondo/src/mondorestore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.c
r2334 r2352 1924 1924 /** int **************************************************************/ 1925 1925 int i = 0; 1926 int res = 0; 1926 1927 int currline = 0; 1927 1928 int finished = FALSE; … … 1929 1930 /** buffers **********************************************************/ 1930 1931 char *tmp = NULL; 1932 char *flaws_str = NULL; 1931 1933 char *flaws_str_A = NULL; 1932 1934 char *flaws_str_B = NULL; … … 1936 1938 assert(raidlist != NULL); 1937 1939 1938 mr_asprintf(flaws_str_A, "%s", " ");1939 mr_asprintf(flaws_str_B, "%s", " ");1940 mr_asprintf(flaws_str_C, "%s", " ");1941 1940 if (mountlist->entries > ARBITRARY_MAXIMUM) { 1942 1941 log_to_screen("Arbitrary limits suck, man!"); … … 1954 1953 mr_asprintf(tmp, "%-24s %-24s %-8s %s", "Device", "Mountpoint", "Format", "Size (MB)"); 1955 1954 headerMsg = newtLabel(2, 1, tmp); 1956 flawsLabelA = newtLabel(2, 13, flaws_str_A);1957 flawsLabelB = newtLabel(2, 14, flaws_str_B);1958 flawsLabelC = newtLabel(2, 15, flaws_str_C);1955 flawsLabelA = newtLabel(2, 13, " "); 1956 flawsLabelB = newtLabel(2, 14, " "); 1957 flawsLabelC = newtLabel(2, 15, " "); 1959 1958 partitionsListbox = 1960 1959 newtListbox(2, 2, 10, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); … … 1966 1965 bEdit, bDelete, bReload, bCancel, bOK, NULL); 1967 1966 while (!finished) { 1968 evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B, 1969 flaws_str_C); 1967 flaws_str = evaluate_mountlist(mountlist, &res); 1968 spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C); 1969 1970 mr_free(flaws_str); 1971 1970 1972 newtLabelSetText(flawsLabelA, flaws_str_A); 1971 1973 newtLabelSetText(flawsLabelB, flaws_str_B); 1972 1974 newtLabelSetText(flawsLabelC, flaws_str_C); 1973 1975 b_res = newtRunForm(myForm); 1976 mr_free(flaws_str_A); 1977 mr_free(flaws_str_B); 1978 mr_free(flaws_str_C); 1979 1974 1980 if (b_res == bOK) { 1975 if (!evaluate_mountlist 1976 (mountlist, flaws_str_A, flaws_str_B, flaws_str_C)) { 1981 flaws_str = evaluate_mountlist(mountlist, &res); 1982 mr_free(flaws_str); 1983 if (!res) { 1977 1984 finished = 1978 1985 ask_me_yes_or_no -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.h
r2316 r2352 137 137 struct raidlist_itself *); 138 138 void edit_raidrec_additional_vars(struct raid_device_record *); 139 int evaluate_mountlist(struct mountlist_itself *, char *, char *, char*);139 char *evaluate_mountlist(struct mountlist_itself *, int *); 140 140 int find_device_in_mountlist(struct mountlist_itself *, char *); 141 141 int find_next_free_index_in_disklist(struct list_of_disks *); … … 180 180 void setup_newt_stuff(void); 181 181 long size_of_specific_device(struct mountlist_itself *, char *); 182 bool spread_flaws_across_three_lines(char *, char *, char *, char *, int);182 void spread_flaws_across_three_lines(char *, char *, char *, char *); 183 183 char *turn_raid_level_number_to_string(int); 184 184 void update_evalcall_form(int); -
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2338 r2352 752 752 /** malloc **/ 753 753 char *tmp = NULL; 754 char *tmpA = NULL; 755 char *tmpB = NULL; 756 char *tmpC = NULL; 754 char *flaws_str = NULL; 757 755 758 756 assert(bkpinfo != NULL); 759 757 assert(mountlist != NULL); 760 758 assert(raidlist != NULL); 761 762 mr_asprintf(tmpA, "%s", " ");763 mr_asprintf(tmpB, "%s", " ");764 mr_asprintf(tmpC, "%s", " ");765 759 766 760 log_msg(2, "nuke_mode --- starting"); … … 773 767 resize_mountlist_proportionately_to_suit_new_drives(mountlist); 774 768 } 775 if (!evaluate_mountlist(mountlist, tmpA, tmpB, tmpC)) { 776 mr_asprintf(tmp, "Mountlist analyzed. Result: \"%s %s %s\" Switch to Interactive Mode?", tmpA, tmpB, tmpC); 769 flaws_str = evaluate_mountlist(mountlist, &res); 770 if (!res) { 771 mr_asprintf(tmp, "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?", flaws_str); 772 mr_free(flaws_str); 777 773 res = ask_me_yes_or_no(tmp); 778 774 mr_free(tmp); … … 784 780 } 785 781 } 782 mr_free(flaws_str); 783 786 784 save_mountlist_to_disk(mountlist, g_mountlist_fname); 787 785 mvaddstr_and_log_it(1, 30, "Restoring Automatically"); -
branches/2.2.10/mondo/src/mondorestore/mr-externs.h
r2325 r2352 109 109 extern bool g_restoring_live_from_nfs; 110 110 extern int fput_string_one_char_at_a_time(FILE *, char *); 111 112 113 114 115 116 extern int 117 evaluate_mountlist(struct mountlist_itself *mountlist, char *flaws_str_A, 118 char *flaws_str_B, char *flaws_str_C); 119 111 extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res); 120 112 121 113
Note:
See TracChangeset
for help on using the changeset viewer.