Changeset 2357 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-mountlist.c
- Timestamp:
- Aug 29, 2009, 3:22:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-mountlist.c
r2352 r2357 821 821 return (1); 822 822 } 823 malloc_string(incoming);824 823 malloc_string(siz); 825 (void) fgets(incoming, MAX_STR_LEN - 1, fin);826 824 log_it("Loading mountlist..."); 825 mr_getline(incoming, fin); 827 826 while (!feof(fin)) { 828 827 #if linux 829 res = sscanf(incoming, 830 "%s %s %s %s %s", 831 mountlist->el[items].device, 832 mountlist->el[items].mountpoint, 833 mountlist->el[items].format, 834 siz, mountlist->el[items].label); 828 res = sscanf(incoming, "%s %s %s %s %s", mountlist->el[items].device, mountlist->el[items].mountpoint, mountlist->el[items].format, siz, mountlist->el[items].label); 835 829 if (res < 5) { 836 830 /* no label found */ … … 839 833 } 840 834 #elif __FreeBSD__ 841 res = sscanf(incoming, 842 "%s %s %s %s", 843 mountlist->el[items].device, 844 mountlist->el[items].mountpoint, 845 mountlist->el[items].format, siz); 835 res = sscanf(incoming, "%s %s %s %s", mountlist->el[items].device, mountlist->el[items].mountpoint, mountlist->el[items].format, siz); 846 836 strcpy(mountlist->el[items].label,""); 847 837 #endif … … 854 844 !strcmp(mountlist->el[items].device, "devpts") 855 845 ) { 856 log_msg(1, 857 "Ignoring %s in mountlist - not loading that line :) ", 858 mountlist->el[items].device); 859 (void) fgets(incoming, MAX_STR_LEN - 1, fin); 846 log_msg(1, "Ignoring %s in mountlist - not loading that line :) ", mountlist->el[items].device); 847 mr_free(incoming); 848 mr_getline(incoming, fin); 860 849 continue; 861 850 } … … 880 869 *(p + 2) = *(p + 3); 881 870 } 882 log_it("It was %s; it is now %s", 883 mountlist->el[items].device, tmp); 871 log_it("It was %s; it is now %s", mountlist->el[items].device, tmp); 884 872 strcpy(mountlist->el[items].device, tmp); 885 873 } 886 874 paranoid_free(tmp); 887 875 888 log_it("%s %s %s %lld %s", 889 mountlist->el[items].device, 890 mountlist->el[items].mountpoint, 891 mountlist->el[items].format, 892 mountlist->el[items].size, 893 mountlist->el[items].label); 876 log_it("%s %s %s %lld %s", mountlist->el[items].device, mountlist->el[items].mountpoint, mountlist->el[items].format, mountlist->el[items].size, mountlist->el[items].label); 894 877 items++; 895 878 if (items >= MAX_MOUNTLIST_ENTRIES) { … … 898 881 } 899 882 } 900 (void) fgets(incoming, MAX_STR_LEN - 1, fin); 901 } 883 mr_free(incoming); 884 mr_getline(incoming, fin); 885 } 886 mr_free(incoming); 902 887 paranoid_fclose(fin); 903 888 mountlist->entries = items; … … 906 891 log_it("%d entries in mountlist", items); 907 892 908 paranoid_free(incoming);909 893 paranoid_free(siz); 910 894 return (0);
Note:
See TracChangeset
for help on using the changeset viewer.