Changeset 2350 in MondoRescue for branches/2.2.9/mondo/src/mondorestore
- Timestamp:
- Aug 28, 2009, 2:24:19 AM (15 years ago)
- Location:
- branches/2.2.9/mondo/src/mondorestore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c
r2230 r2350 1933 1933 /** int **************************************************************/ 1934 1934 int i = 0; 1935 int res = 0; 1935 1936 int currline = 0; 1936 1937 int finished = FALSE; … … 1938 1939 /** buffers **********************************************************/ 1939 1940 char tmp[MAX_STR_LEN]; 1941 char *flaws_str = NULL; 1940 1942 char *flaws_str_A = NULL; 1941 1943 char *flaws_str_B = NULL; … … 1945 1947 assert(raidlist != NULL); 1946 1948 1947 mr_asprintf(&flaws_str_A, "%s", " ");1948 mr_asprintf(&flaws_str_B, "%s", " ");1949 mr_asprintf(&flaws_str_C, "%s", " ");1950 1949 if (mountlist->entries > ARBITRARY_MAXIMUM) { 1951 1950 log_to_screen("Arbitrary limits suck, man!"); … … 1964 1963 "Size (MB)"); 1965 1964 headerMsg = newtLabel(2, 1, tmp); 1966 flawsLabelA = newtLabel(2, 13, flaws_str_A);1967 flawsLabelB = newtLabel(2, 14, flaws_str_B);1968 flawsLabelC = newtLabel(2, 15, flaws_str_C);1965 flawsLabelA = newtLabel(2, 13, " "); 1966 flawsLabelB = newtLabel(2, 14, " "); 1967 flawsLabelC = newtLabel(2, 15, " "); 1969 1968 partitionsListbox = 1970 1969 newtListbox(2, 2, 10, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); … … 1976 1975 bEdit, bDelete, bReload, bCancel, bOK, NULL); 1977 1976 while (!finished) { 1978 evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B, 1979 flaws_str_C); 1977 flaws_str = evaluate_mountlist(mountlist, &res); 1978 spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C); 1979 1980 mr_free(flaws_str); 1981 1980 1982 newtLabelSetText(flawsLabelA, flaws_str_A); 1981 1983 newtLabelSetText(flawsLabelB, flaws_str_B); 1982 1984 newtLabelSetText(flawsLabelC, flaws_str_C); 1983 1985 b_res = newtRunForm(myForm); 1986 mr_free(flaws_str_A); 1987 mr_free(flaws_str_B); 1988 mr_free(flaws_str_C); 1989 1984 1990 if (b_res == bOK) { 1985 if (!evaluate_mountlist 1986 (mountlist, flaws_str_A, flaws_str_B, flaws_str_C)) { 1991 flaws_str = evaluate_mountlist(mountlist, &res); 1992 mr_free(flaws_str); 1993 if (!res) { 1987 1994 finished = 1988 1995 ask_me_yes_or_no … … 2038 2045 } 2039 2046 } 2040 paranoid_free(flaws_str_A);2041 paranoid_free(flaws_str_B);2042 paranoid_free(flaws_str_C);2043 2047 newtFormDestroy(myForm); 2044 2048 newtPopWindow(); -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.h
r2202 r2350 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.9/mondo/src/mondorestore/mondorestore.c
r2290 r2350 777 777 /** malloc **/ 778 778 char tmp[MAX_STR_LEN]; 779 char *tmpA; 780 char *tmpB; 781 char *tmpC; 779 char *flaws_str = NULL; 782 780 783 781 assert(bkpinfo != NULL); 784 782 assert(mountlist != NULL); 785 783 assert(raidlist != NULL); 786 787 mr_asprintf(&tmpA, "%s", " ");788 mr_asprintf(&tmpB, "%s", " ");789 mr_asprintf(&tmpC, "%s", " ");790 784 791 785 log_msg(2, "nuke_mode --- starting"); … … 807 801 resize_mountlist_proportionately_to_suit_new_drives(mountlist); 808 802 } 809 if (!evaluate_mountlist(mountlist, tmpA, tmpB, tmpC)) { 803 flaws_str = evaluate_mountlist(mountlist, &res); 804 if (!res) { 810 805 sprintf(tmp, 811 "Mountlist analyzed. Result: \"%s %s %s\" Switch to Interactive Mode?", 812 tmpA, tmpB, tmpC); 806 "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?", 807 flaws_str); 808 mr_free(flaws_str); 813 809 if (ask_me_yes_or_no(tmp)) { 814 810 retval = interactive_mode(mountlist, raidlist); … … 818 814 } 819 815 } 816 mr_free(flaws_str); 817 820 818 save_mountlist_to_disk(mountlist, g_mountlist_fname); 821 819 mvaddstr_and_log_it(1, 30, "Restoring Automatically"); -
branches/2.2.9/mondo/src/mondorestore/mr-externs.h
r2109 r2350 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.