From 20e5c59fd89af35715bfc5ddd2d0c38555bbb105 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Sep 14 2012 15:50:46 +0000 Subject: Ticket #463 - different parameters of getmntent in Solaris https://fedorahosted.org/389/ticket/463 Reviewed by: rmeggins Fixed by: cgrzemba Branch: master Fix Description: move stdio.h to before the include of mnttab.h on Solaris the argument to getmntent is the address of the structure to fill in Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no --- diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index 0abc3b6..0d3d81f 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -82,6 +82,7 @@ #endif /* NEED_FILIO */ #endif /* !defined( _WIN32 ) */ /* for some reason, linux tty stuff defines CTIME */ +#include #ifdef LINUX #undef CTIME #include @@ -94,7 +95,6 @@ #include "snmp_collator.h" #include #include -#include #include "fe.h" #if defined(ENABLE_LDAPI) @@ -484,7 +484,7 @@ time_thread(void *nothing) char * disk_mon_get_mount_point(char *dir) { - struct mnttab *mnt; + struct mnttab mnt; struct stat s; dev_t dev_id; FILE *fp; @@ -497,12 +497,12 @@ disk_mon_get_mount_point(char *dir) dev_id = s.st_dev; - while((mnt = getmntent(fp))){ - if (stat(mnt->mnt_mountp, &s) != 0) { + while((0 = getmntent(fp, &mnt))){ + if (stat(mnt.mnt_mountp, &s) != 0) { continue; } if (s.st_dev == dev_id) { - return (slapi_ch_strdup(mnt->mnt_mountp)); + return (slapi_ch_strdup(mnt.mnt_mountp)); } }