Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/libbb/find_mount_point.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/libbb/find_mount_point.c
r821 r1770 8 8 */ 9 9 10 #include <stdio.h>11 #include <string.h>12 10 #include "libbb.h" 11 #include <mntent.h> 13 12 14 15 #include <mntent.h>16 13 /* 17 14 * Given a block device, find the mount table entry if that block device … … 37 34 38 35 39 if ((mountTable = setmntent(table ? table : bb_path_mtab_file, "r")) == 0) 36 mountTable = setmntent(table ? table : bb_path_mtab_file, "r"); 37 if (!mountTable) 40 38 return 0; 41 39 42 40 while ((mountEntry = getmntent(mountTable)) != 0) { 43 44 if(strcmp(name, mountEntry->mnt_dir) == 045 || strcmp(name, mountEntry->mnt_fsname) == 0)/* String match. */41 if (strcmp(name, mountEntry->mnt_dir) == 0 42 || strcmp(name, mountEntry->mnt_fsname) == 0 43 ) { /* String match. */ 46 44 break; 45 } 47 46 if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */ 48 47 break;
Note:
See TracChangeset
for help on using the changeset viewer.