58 |
* In the case of success, mountpoint is stored in device information |
* In the case of success, mountpoint is stored in device information |
59 |
* structure for later use. |
* structure for later use. |
60 |
* |
* |
61 |
* @param devinfo Information structure where resulting data will be stored |
* @param devinfo Information structure where resulting data will be stored |
62 |
* @param object Identifies block special device |
* @param blockdev Identifies block special device |
63 |
* @return NULL in the case of failure otherwise mountpoint |
* @return NULL in the case of failure otherwise mountpoint |
64 |
*/ |
*/ |
65 |
char *DeviceInfo_MountPoint_sysdep(DeviceInfo_T devinfo, char *object) { |
char *DeviceInfo_MountPoint_sysdep(DeviceInfo_T devinfo, char *blockdev) { |
66 |
|
|
67 |
struct mnttab mnt; |
struct mnttab mnt; |
68 |
FILE *mntfd; |
FILE *mntfd; |
69 |
|
|
70 |
ASSERT(devinfo); |
ASSERT(devinfo); |
71 |
ASSERT(object); |
ASSERT(blockdev); |
72 |
|
|
73 |
|
|
74 |
if((mntfd= fopen("/etc/mnttab", "r")) == NULL) { |
if((mntfd= fopen("/etc/mnttab", "r")) == NULL) { |
79 |
/* First match is significant */ |
/* First match is significant */ |
80 |
while(getmntent(mntfd, &mnt) == 0) { |
while(getmntent(mntfd, &mnt) == 0) { |
81 |
|
|
82 |
if(IS(object, mnt.mnt_special)) { |
if(IS(blockdev, mnt.mnt_special)) { |
83 |
|
|
84 |
fclose(mntfd); |
fclose(mntfd); |
85 |
return strncpy(devinfo->mntpath, mnt.mnt_mountp, sizeof(devinfo->mntpath)); |
return strncpy(devinfo->mntpath, mnt.mnt_mountp, sizeof(devinfo->mntpath)); |