Changeset 2394 in MondoRescue
- Timestamp:
- Sep 12, 2009, 2:53:02 AM (15 years ago)
- Location:
- branches/2.2.9/mondo
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-mountlist-EXT.h
r2384 r2394 1 1 /* libmondo-mountlist-EXT.h */ 2 2 3 extern char *evaluate_mountlist(struct mountlist_itself *mountlist , int *res);3 extern char *evaluate_mountlist(struct mountlist_itself *mountlist); 4 4 extern int find_device_in_mountlist(struct mountlist_itself *mountlist, 5 5 char *device); -
branches/2.2.9/mondo/src/common/libmondo-mountlist.c
r2384 r2394 498 498 * for each drive, and then spreads the flaws across three lines. 499 499 * @param mountlist The mountlist to evaluate. 500 * @param flaws_str_A Where to put the first line listing errors found. 501 * @param flaws_str_B Where to put the second line listing errors found. 502 * @param flaws_str_C Where to put the third line listing errors found. 503 * @return The number of flaws found (0 for success). 500 * @return The flaws string (NULL for success). 504 501 * @see evaluate_drive_within_mountlist 505 502 */ 506 char *evaluate_mountlist(struct mountlist_itself *mountlist , int *res) {503 char *evaluate_mountlist(struct mountlist_itself *mountlist) { 507 504 508 505 /*@ buffer *********************************************************** */ … … 523 520 /*@ initialize ******************************************************* */ 524 521 525 *res = 0;526 522 drivelist = malloc(sizeof(struct list_of_disks)); 527 523 assert(mountlist != NULL); 528 529 mr_asprintf(&flaws_str, "%s", "");530 524 531 525 make_list_of_drives_in_mountlist(mountlist, drivelist); … … 543 537 log_msg(8, "Evaluating drive #%d (%s) within mountlist", i, drivelist->el[i].device); 544 538 tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device); 545 if (tmp != NULL) {546 (*res)++;547 }548 539 } 549 540 log_msg(8,"Entry: %d (%s)", i, drivelist->el[i].device); 550 541 /* BCO: tmp can be NULL */ 551 542 if (tmp != NULL) { 552 log_msg(8,"Adding: %s to %s", tmp, flaws_str);543 log_msg(8,"Adding: %s to flaws_str", tmp); 553 544 mr_strcat(flaws_str, "%s", tmp); 554 545 paranoid_free(tmp); … … 571 562 mr_asprintf(&tmp, " %s %s's.", number_to_text(copies), curr_mountpoint); 572 563 mr_strcat(flaws_str, "%s", tmp); 573 log_ it(tmp);564 log_msg(8,"Adding: %s to flaws_str", tmp); 574 565 paranoid_free(tmp); 575 (*res)++;576 566 } 577 567 paranoid_free(curr_mountpoint); -
branches/2.2.9/mondo/src/common/libmondo-mountlist.h
r2384 r2394 4 4 5 5 6 char *evaluate_mountlist(struct mountlist_itself *mountlist , int *res);6 char *evaluate_mountlist(struct mountlist_itself *mountlist); 7 7 int find_device_in_mountlist(struct mountlist_itself *mountlist, 8 8 char *device); -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c
r2380 r2394 1933 1933 /** int **************************************************************/ 1934 1934 int i = 0; 1935 int res = 0;1936 1935 int currline = 0; 1937 1936 int finished = FALSE; … … 1975 1974 bEdit, bDelete, bReload, bCancel, bOK, NULL); 1976 1975 while (!finished) { 1977 flaws_str = evaluate_mountlist(mountlist , &res);1976 flaws_str = evaluate_mountlist(mountlist); 1978 1977 if (strlen(flaws_str) > 0) { 1979 1978 mr_asprintf(&flaws_str_A, "%s", flaws_str + 1); … … 2006 2005 2007 2006 if (b_res == bOK) { 2008 flaws_str = evaluate_mountlist(mountlist , &res);2009 mr_free(flaws_str);2010 if (!res) {2007 flaws_str = evaluate_mountlist(mountlist); 2008 if (flaws_str != NULL) { 2009 mr_free(flaws_str); 2011 2010 finished = 2012 2011 ask_me_yes_or_no -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.h
r2384 r2394 137 137 struct raidlist_itself *); 138 138 void edit_raidrec_additional_vars(struct raid_device_record *); 139 char *evaluate_mountlist(struct mountlist_itself * , int *);139 char *evaluate_mountlist(struct mountlist_itself *); 140 140 int find_device_in_mountlist(struct mountlist_itself *, char *); 141 141 int find_next_free_index_in_disklist(struct list_of_disks *); -
branches/2.2.9/mondo/src/mondorestore/mondorestore.c
r2381 r2394 793 793 resize_mountlist_proportionately_to_suit_new_drives(mountlist); 794 794 } 795 flaws_str = evaluate_mountlist(mountlist , &res);796 if ( !res) {795 flaws_str = evaluate_mountlist(mountlist); 796 if (flaws_str != NULL) { 797 797 sprintf(tmp, 798 798 "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?", … … 806 806 } 807 807 } 808 mr_free(flaws_str);809 808 810 809 save_mountlist_to_disk(mountlist, g_mountlist_fname); -
branches/2.2.9/mondo/src/mondorestore/mr-externs.h
r2380 r2394 109 109 extern bool g_restoring_live_from_netfs; 110 110 extern int fput_string_one_char_at_a_time(FILE *, char *); 111 extern char *evaluate_mountlist(struct mountlist_itself *mountlist , int *res);111 extern char *evaluate_mountlist(struct mountlist_itself *mountlist); 112 112 113 113 -
branches/2.2.9/mondo/test/test-mountlist.c
r2350 r2394 50 50 struct mountlist_itself *mountlist = NULL; 51 51 struct raidlist_itself *raidlist = NULL; 52 int ret = 0;53 52 char *flaws_str = NULL; 54 53 … … 80 79 log_it("after edit_mountlist"); 81 80 82 flaws_str = evaluate_mountlist(mountlist , &ret);81 flaws_str = evaluate_mountlist(mountlist); 83 82 log_it("after evaluate_mountlist"); 84 83 mr_free(flaws_str);
Note:
See TracChangeset
for help on using the changeset viewer.