Changeset 783 in MondoRescue for trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
- Timestamp:
- Aug 31, 2006, 5:09:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
r764 r783 537 537 char *personalities = NULL; 538 538 char *prompt = NULL; 539 char *sz = NULL;540 539 int out = 0, res = 0; 541 540 … … 544 543 system 545 544 ("grep Pers /proc/mdstat > /tmp/raid-personalities.txt 2> /dev/null"); 546 personalities = last_line_of_file("/tmp/raid-personalities.txt") );545 personalities = last_line_of_file("/tmp/raid-personalities.txt"); 547 546 asprintf(&prompt, _("Please enter the RAID level you want. %s"), 548 547 personalities); … … 616 615 int i = 0; 617 616 int pos = 0; 618 619 /** buffers ***********************************************************/620 char *tmp = NULL;621 617 622 618 assert(mountlist != NULL); … … 858 854 popup_and_OK(tmp); 859 855 } else { 856 paranoid_free(av->el[lino].label); 857 paranoid_free(av->el[lino].value); 860 858 memcpy((void *) &av->el[lino], (void *) &av->el[av->entries--], 861 859 sizeof(struct raid_var_line)); 860 /* BERLIOS: New way of doing should be replaced by line below. Hope it's ok. 861 * Will be when memory for struct is also dynamically allocated 862 av->el[lino] = av->el[av->entries--]; 863 */ 862 864 } 863 865 } … … 1323 1325 device); 1324 1326 if (j < 0) { 1325 sprintf(tmp,1327 asprintf(&tmp, 1326 1328 _ 1327 1329 ("/etc/raidtab does not have an entry for %s; please delete it and add it again"), 1328 1330 mountlist->el[currline].device); 1329 1331 popup_and_OK(tmp); 1332 paranoid_free(tmp); 1330 1333 } else { 1331 1334 log_it(_("edit_raidlist_entry - calling")); … … 1499 1502 1500 1503 void *keylist[10]; 1501 void *curr_choice ;1504 void *curr_choice = NULL; 1502 1505 1503 1506 int currline2 = 0; … … 1971 1974 raidrec->additional_vars.el[lino].label, sz_out); 1972 1975 if (popup_and_get_string(header, comment, sz_out)) { 1973 strcpy(raidrec->additional_vars.el[lino].value, sz_out); 1976 paranoid_free(raidrec->additional_vars.el[lino].value); 1977 raidrec->additional_vars.el[lino].value = sz_out; 1974 1978 } 1975 1979 paranoid_free(header); 1976 1980 paranoid_free(comment); 1977 paranoid_free(sz_out);1978 1981 } 1979 1982 #endif … … 2015 2018 int currline = 0; 2016 2019 int finished = FALSE; 2020 int res = 0; 2017 2021 2018 2022 /** buffers **********************************************************/ … … 2025 2029 assert(raidlist != NULL); 2026 2030 2027 asprintf(&flaws_str_A, "xxxxxxxxx");2028 asprintf(&flaws_str_B, "xxxxxxxxx");2029 asprintf(&flaws_str_C, "xxxxxxxxx");2030 2031 if (mountlist->entries > ARBITRARY_MAXIMUM) { 2031 2032 log_to_screen(_("Arbitrary limits suck, man!")); … … 2045 2046 _("Format"), _("Size (MB)")); 2046 2047 headerMsg = newtLabel(2, 1, tmp); 2047 flawsLabelA = newtLabel(2, 13, flaws_str_A);2048 flawsLabelB = newtLabel(2, 14, flaws_str_B);2049 flawsLabelC = newtLabel(2, 15, flaws_str_C);2048 flawsLabelA = newtLabel(2, 13, "x"); 2049 flawsLabelB = newtLabel(2, 14, "x"); 2050 flawsLabelC = newtLabel(2, 15, "x"); 2050 2051 partitionsListbox = 2051 2052 newtListbox(2, 2, 10, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); … … 2057 2058 bEdit, bDelete, bReload, bCancel, bOK, NULL); 2058 2059 while (!finished) { 2059 evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B,2060 res = evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B, 2060 2061 flaws_str_C); 2061 2062 newtLabelSetText(flawsLabelA, flaws_str_A); 2062 2063 newtLabelSetText(flawsLabelB, flaws_str_B); 2063 2064 newtLabelSetText(flawsLabelC, flaws_str_C); 2065 2066 paranoid_free(flaws_str_A); 2067 paranoid_free(flaws_str_B); 2068 paranoid_free(flaws_str_C); 2069 2064 2070 b_res = newtRunForm(myForm); 2065 2071 /* BERLIOS: This needs to be re-written */ 2066 2072 if (b_res == bOK) { 2067 if (!evaluate_mountlist 2068 (mountlist, flaws_str_A, flaws_str_B, flaws_str_C)) { 2073 if (!res) { 2069 2074 finished = 2070 2075 ask_me_yes_or_no … … 2113 2118 } 2114 2119 } 2115 paranoid_free(flaws_str_A);2116 paranoid_free(flaws_str_B);2117 paranoid_free(flaws_str_C);2118 2120 } 2119 2121 newtFormDestroy(myForm); … … 2413 2415 raidrec = &raidlist->el[pos_in_raidlist]; 2414 2416 initialize_raidrec(raidrec); 2415 strcpy(raidrec->OSSWAP(raid_device, volname),2417 asprintf(&raidrec->OSSWAP(raid_device, volname), 2416 2418 OSSWAP(device, basename(device))); 2417 2419 #ifndef __FreeBSD__ … … 2647 2649 (void *) &raidrec->additional_vars.el[i], 2648 2650 sizeof(struct raid_var_line)); 2651 /* BERLIOS : To be changed */ 2649 2652 } 2650 2653 raidrec->additional_vars.entries--;
Note:
See TracChangeset
for help on using the changeset viewer.