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