Changeset 839 in MondoRescue for trunk/mondo/src/common
- Timestamp:
- Sep 26, 2006, 9:47:32 AM (18 years ago)
- Location:
- trunk/mondo/src/common
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/Makefile.am
r826 r839 8 8 9 9 libmondo_a_SOURCES = libmondo-archive.c libmondo-devices.c libmondo-fifo.c \ 10 libmondo-filelist.c libmondo-files.c libmondo-fork.c \ 11 libmondo-mountlist.c libmondo-raid.c libmondo-msg.c \ 12 libmondo-stream.c libmondo-string.c libmondo-tools.c \ 13 libmondo-verify.c newt-specific.c \ 14 libmondo-archive.h libmondo-devices.h \ 15 libmondo-filelist.h libmondo-files.h libmondo-fork.h \ 16 libmondo-mountlist.h libmondo-raid.h \ 17 libmondo-stream.h libmondo-string.h libmondo-tools.h \ 18 libmondo-verify.h libmondo-fifo.h \ 19 libmondo-archive-EXT.h my-stuff.h mondostructures.h \ 20 libmondo-devices-EXT.h libmondo-fifo-EXT.h \ 21 libmondo-files-EXT.h libmondo-fork-EXT.h \ 22 libmondo-filelist-EXT.h \ 23 libmondo-mountlist-EXT.h libmondo-raid-EXT.h \ 24 libmondo-string-EXT.h libmondo-tools-EXT.h \ 25 libmondo-verify-EXT.h libmondo-stream-EXT.h \ 26 newt-specific.h 10 libmondo-msg.c \ 11 libmondo-filelist.c libmondo-files.c libmondo-fork.c \ 12 libmondo-mountlist.c libmondo-raid.c \ 13 libmondo-stream.c libmondo-string.c libmondo-tools.c \ 14 libmondo-verify.c newt-specific.c \ 15 libmondo-archive.h libmondo-devices.h \ 16 libmondo-filelist.h libmondo-files.h libmondo-fork.h \ 17 libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \ 18 libmondo-stream.h libmondo-string.h libmondo-tools.h \ 19 libmondo-verify.h libmondo-fifo.h \ 20 libmondo-archive-EXT.h my-stuff.h mondostructures.h \ 21 libmondo-devices-EXT.h libmondo-fifo-EXT.h \ 22 libmondo-files-EXT.h libmondo-fork-EXT.h \ 23 libmondo-gui-EXT.h libmondo-filelist-EXT.h \ 24 libmondo-mountlist-EXT.h libmondo-raid-EXT.h \ 25 libmondo-string-EXT.h libmondo-tools-EXT.h \ 26 libmondo-verify-EXT.h libmondo-stream-EXT.h \ 27 newt-specific.h -
trunk/mondo/src/common/libmondo-devices.c
r835 r839 2026 2026 asprintf(&exclude_these_devices, 2027 2027 call_program_and_get_last_line_of_output 2028 ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs| afs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));2028 ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'")); 2029 2029 */ 2030 2030 } -
trunk/mondo/src/common/libmondo-filelist.c
r795 r839 17 17 #include "newt-specific-EXT.h" 18 18 #include "libmondo-tools-EXT.h" 19 19 #include "mr_string.h" 20 20 21 21 #include <time.h> … … 1318 1318 char *skeleton_filelist) 1319 1319 { 1320 const char delims[] = " "; 1320 1321 DIR *dip = NULL; 1321 1322 struct dirent *dit = NULL; 1323 1322 1324 struct stat statbuf; 1323 1325 char *new = NULL; … … 1329 1331 static char *name_of_evalcall_form = NULL; 1330 1332 int i = 0; 1333 char *strtmp = NULL; 1334 char *token = NULL; 1335 char *find_excludes = NULL; 1336 int lastpos = 0; 1331 1337 static int depth = 0; 1332 1338 char *p = NULL; … … 1347 1353 if (!depth) { 1348 1354 malloc_string(find_skeleton_marker); 1355 asprintf(&find_excludes, " "); 1356 while((token = mr_strtok (sth, delims, &lastpos))) { 1357 asprintf(&strtmp,"%s", find_excludes); 1358 paranoid_free(find_excludes); 1359 asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token); 1360 paranoid_free(strtmp); 1361 paranoid_free(token); 1362 } 1349 1363 #if linux 1350 1364 // 2.6 has /sys as a proc-type thing -- must be excluded 1351 asprintf(& tmp,1352 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a-print > %s 2> /dev/null",1353 dir, MAX_SKEL_DEPTH,skeleton_filelist);1365 asprintf(&strtmp, 1366 "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null", 1367 dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1354 1368 #else 1355 1369 // On BSD, for example, /sys is the kernel sources -- don't exclude 1356 asprintf(&tmp, 1357 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null", 1358 dir, MAX_SKEL_DEPTH, skeleton_filelist); 1370 asprintf(&strtmp, 1371 "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null", 1372 dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1373 >>>>>>> .merge-right.r838 1359 1374 #endif 1360 system(tmp); 1375 paranoid_free(find_excludes); 1376 log_msg(5, "find command = %s", strtmp); 1377 system(strtmp); 1378 paranoid_free(strtmp); 1361 1379 paranoid_free(tmp); 1362 1380 -
trunk/mondo/src/common/libmondo-files.c
r808 r839 772 772 773 773 asprintf(&command, "du -sk %s", mountpt); 774 errno = 0; 774 775 fin = popen(command, "r"); 775 paranoid_free(command); 776 777 (void) getline(&tmp, &n, fin); 778 paranoid_pclose(fin); 779 p = strchr(tmp, '\t'); 780 if (p) { 781 *p = '\0'; 782 } 783 for (p = tmp, llres = 0; *p != '\0'; p++) { 784 llres *= 10; 785 llres += (int) (*p - '0'); 786 } 776 if (errno) { 777 log_it("popen() FAILED: command=%s, mountpt=%s, fin=%d, errno=%d, strerror=%s", command, mountpt, fin, errno, strerror(errno)); 778 llres = 0; 779 } else { 780 (void) getline(&tmp, &n, fin); 781 paranoid_pclose(fin); 782 p = strchr(tmp, '\t'); 783 if (p) { 784 *p = '\0'; 785 } 786 for (p = tmp, llres = 0; *p != '\0'; p++) { 787 llres *= 10; 788 llres += (int) (*p - '0'); 789 } 790 } 791 792 paranoid_free(command); 787 793 paranoid_free(tmp); 788 794 return (llres); -
trunk/mondo/src/common/libmondo-raid.c
r783 r839 16 16 #include "libmondo-string-EXT.h" 17 17 #include "libmondo-raid.h" 18 #include "mr_string.h" 18 19 19 20 #ifdef __FreeBSD__
Note:
See TracChangeset
for help on using the changeset viewer.