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

Diff of /monit/device/sysdep_SOLARIS.c

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

revision 1.2 by martinp, Sun Jul 6 20:24:58 2003 UTC revision 1.3 by martinp, Mon Jul 7 06:40:46 2003 UTC
# Line 58  Line 58 
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) {
# Line 79  char *DeviceInfo_MountPoint_sysdep(Devic Line 79  char *DeviceInfo_MountPoint_sysdep(Devic
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));

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