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

Diff of /monit/device/sysdep_HPUX.c

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

revision 1.2 by martinp, Sun Jul 6 22:57:01 2003 UTC revision 1.3 by martinp, Mon Jul 7 06:40:46 2003 UTC
# Line 50  Line 50 
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) {
# Line 71  char *DeviceInfo_MountPoint_sysdep(Devic Line 71  char *DeviceInfo_MountPoint_sysdep(Devic
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));

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

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