Browse Source

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
Rich Megginson 13 years ago
parent
commit
20e5c59fd8
1 changed files with 5 additions and 5 deletions
  1. 5 5
      ldap/servers/slapd/daemon.c

+ 5 - 5
ldap/servers/slapd/daemon.c

@@ -82,6 +82,7 @@
 #endif /* NEED_FILIO */
 #endif /* NEED_FILIO */
 #endif /* !defined( _WIN32 ) */
 #endif /* !defined( _WIN32 ) */
 /* for some reason, linux tty stuff defines CTIME */
 /* for some reason, linux tty stuff defines CTIME */
+#include <stdio.h>
 #ifdef LINUX
 #ifdef LINUX
 #undef CTIME
 #undef CTIME
 #include <sys/statfs.h>
 #include <sys/statfs.h>
@@ -94,7 +95,6 @@
 #include "snmp_collator.h"
 #include "snmp_collator.h"
 #include <private/pprio.h>
 #include <private/pprio.h>
 #include <ssl.h>
 #include <ssl.h>
-#include <stdio.h>
 #include "fe.h"
 #include "fe.h"
 
 
 #if defined(ENABLE_LDAPI)
 #if defined(ENABLE_LDAPI)
@@ -484,7 +484,7 @@ time_thread(void *nothing)
 char *
 char *
 disk_mon_get_mount_point(char *dir)
 disk_mon_get_mount_point(char *dir)
 {
 {
-    struct mnttab *mnt;
+    struct mnttab mnt;
     struct stat s;
     struct stat s;
     dev_t dev_id;
     dev_t dev_id;
     FILE *fp;
     FILE *fp;
@@ -497,12 +497,12 @@ disk_mon_get_mount_point(char *dir)
 
 
     dev_id = s.st_dev;
     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;
             continue;
         }
         }
         if (s.st_dev == dev_id) {
         if (s.st_dev == dev_id) {
-            return (slapi_ch_strdup(mnt->mnt_mountp));
+            return (slapi_ch_strdup(mnt.mnt_mountp));
         }
         }
     }
     }