53 |
* In the case of success, mountpoint is stored in device information |
* In the case of success, mountpoint is stored in device information |
54 |
* structure for later use. |
* structure for later use. |
55 |
* |
* |
56 |
* @param devinfo Information structure where resulting data will be stored |
* @param devinfo Information structure where resulting data will be stored |
57 |
* @param object Identifies block special device |
* @param blockdev Identifies block special device |
58 |
* @return NULL in the case of failure otherwise mountpoint |
* @return NULL in the case of failure otherwise mountpoint |
59 |
*/ |
*/ |
60 |
char *DeviceInfo_MountPoint_sysdep(DeviceInfo_T devinfo, char *object) { |
char *DeviceInfo_MountPoint_sysdep(DeviceInfo_T devinfo, char *blockdev) { |
61 |
|
|
62 |
struct mntent *mnt; |
struct mntent *mnt; |
63 |
FILE *mntfd; |
FILE *mntfd; |
64 |
|
|
65 |
ASSERT(devinfo); |
ASSERT(devinfo); |
66 |
ASSERT(object); |
ASSERT(blockdev); |
67 |
|
|
68 |
|
|
69 |
if((mntfd= setmntent("/etc/mtab", "r")) == NULL) { |
if((mntfd= setmntent("/etc/mtab", "r")) == NULL) { |
74 |
/* First match is significant */ |
/* First match is significant */ |
75 |
while((mnt= getmntent(mntfd)) != NULL) { |
while((mnt= getmntent(mntfd)) != NULL) { |
76 |
|
|
77 |
if(IS(object, mnt->mnt_fsname)) { |
if(IS(blockdev, mnt->mnt_fsname)) { |
78 |
|
|
79 |
endmntent(mntfd); |
endmntent(mntfd); |
80 |
return strncpy(devinfo->mntpath, mnt->mnt_dir, sizeof(devinfo->mntpath)); |
return strncpy(devinfo->mntpath, mnt->mnt_dir, sizeof(devinfo->mntpath)); |