! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
exo-mount-point.c does not compile on solaris 2.8
Status:
CLOSED: FIXED

Comments

Description Thomas Wiegner 2007-01-23 12:15:45 CET
User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0
Build Identifier: 

exo-mount-point.c does not compile on solaris 2.8 due to 2 reasons.

1.) the setmntent function is used, although it does not exist on solaris 2.8.
2.) solaris 2.8 needs the stdio.h included before mntent.h is included.

Here is a patch to fix this:

--------------------------------------------->

--- exo-mount-point.c_old       2007-01-22 12:09:13.545343000 +0100
+++ exo-mount-point.c   2007-01-23 13:06:08.825124000 +0100
@@ -22,6 +22,9 @@
 #include <config.h>
 #endif

+#include <stdlib.h>
+#include <stdio.h>
+
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -50,9 +53,6 @@
 #ifdef HAVE_MEMORY_H
 #include <memory.h>
 #endif
-#ifdef HAVE_MNTENT_H
-#include <mntent.h>
-#endif
 #ifdef HAVE_PATHS_H
 #include <paths.h>
 #endif
@@ -63,6 +63,9 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
+#endif

 #include <exo/exo-mount-point.h>
 #include <exo/exo-private.h>
@@ -227,7 +230,7 @@
   FILE         *fp;

   /* try to open the /etc/mnttab file */
-  fp = setmntent ("/etc/mnttab", "r");
+  fp = fopen ("/etc/mnttab", "r");
   if (G_UNLIKELY (fp == NULL))
     {
       g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),



<-----------------------------------------

Reproducible: Always

Steps to Reproduce:
Comment 1 Thomas Wiegner 2007-01-23 14:03:19 CET
*** Bug 2800 has been marked as a duplicate of this bug. ***
Comment 2 Benedikt Meurer editbugs 2007-02-12 19:31:37 CET
Fixed with revision 24963.

2007-02-12      Benedikt Meurer <benny@xfce.org>

        * exo/exo-mount-point.c: Fix compilation on Solaris 2.8. Bug #2798.

Bug #2798

Reported by:
Thomas Wiegner
Reported on: 2007-01-23
Last modified on: 2009-10-09
Duplicates (1):
  • 2800 exo-mount-point.c does not compile on solaris 2.8

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Attachments

Additional information