/[monit]/monit/device/sysdep_LINUX.c
ViewVC logotype

Diff of /monit/device/sysdep_LINUX.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by martinp, Sun Jul 6 18:29:38 2003 UTC revision 1.2 by martinp, Mon Jul 7 06:40:46 2003 UTC
# Line 53  Line 53 
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) {
# Line 74  char *DeviceInfo_MountPoint_sysdep(Devic Line 74  char *DeviceInfo_MountPoint_sysdep(Devic
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));

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26