gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] Problems building on OpenSolaris


From: Shehjar Tikoo
Subject: Re: [Gluster-devel] Problems building on OpenSolaris
Date: Mon, 18 May 2009 20:33:59 +0530
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Actually. you could avoid waiting that time
and use the attached patch to build it on Solaris.

You could update from the repo when it becomes available there.

Regards
Shehjar


Tomasz Z. Napierala wrote:
Dnia 2009-05-18, pon o godzinie 16:54 +0200, Shehjar Tikoo pisze:
Tomasz Z. Napierala wrote:
Hi there,

Hi Tomasz,

A patch to fix this is ready now.
Give us a few hours to push it upstream.

Thanks for prompt response. Will test ASAP.

Regards,

>From d4f86064bbdd6882d921c9e6c741fce9fc6f646c Mon Sep 17 00:00:00 2001
From: Shehjar Tikoo <address@hidden>
Date: Sun, 17 May 2009 15:48:32 +0530
Subject: [PATCH] libglusterfs: Remove use of GNU extensions

Use of GNU extensions was a relic of the past because, this
code was copied from glibc. For our purpose, all that was simply
, "too much ado for nothing".

This also fixed build failures reported for Solaris.
---
 libglusterfs/src/glusterfs_fstab.c |   18 +++---------------
 libglusterfs/src/glusterfs_fstab.h |    4 ----
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/libglusterfs/src/glusterfs_fstab.c 
b/libglusterfs/src/glusterfs_fstab.c
index b21197b..514646e 100644
--- a/libglusterfs/src/glusterfs_fstab.c
+++ b/libglusterfs/src/glusterfs_fstab.c
@@ -20,7 +20,6 @@
 
 #include <alloca.h>
 #include <stdio.h>
-#include <stdio_ext.h>
 #include <string.h>
 #include <sys/types.h>
 #include "glusterfs_fstab.h"
@@ -32,20 +31,12 @@ glusterfs_fstab_t *
 glusterfs_fstab_init (const char *file, const char *mode)
 {
   glusterfs_fstab_t *handle = NULL;
-  /* Extend the mode parameter with "c" to disable cancellation in the
-     I/O functions.  */
-  size_t modelen = strlen (mode);
-  char newmode[modelen + 2];
-  memcpy (mempcpy (newmode, mode, modelen), "c", 2);
-
   handle = calloc (1, sizeof (glusterfs_fstab_t));
   if (!handle)
           goto out;
 
-  FILE *result = fopen (file, newmode);
+  FILE *result = fopen (file, mode);
   if (result != NULL) {
-    /* We do the locking ourselves.  */
-    __fsetlocking (result, FSETLOCKING_BYCALLER);
     handle->fp = result;
   } else {
           free (handle);
@@ -128,14 +119,12 @@ __glusterfs_fstab_getent (FILE *stream, struct 
glusterfs_mntent *mp,
   char *cp;
   char *head;
 
-  flockfile (stream);
   do
     {
       char *end_ptr;
 
-      if (fgets_unlocked (buffer, bufsiz, stream) == NULL)
+      if (fgets (buffer, bufsiz, stream) == NULL)
        {
-         funlockfile (stream);
          return NULL;
        }
 
@@ -146,7 +135,7 @@ __glusterfs_fstab_getent (FILE *stream, struct 
glusterfs_mntent *mp,
        {
          /* Not the whole line was read.  Do it now but forget it.  */
          char tmp[1024];
-         while (fgets_unlocked (tmp, sizeof tmp, stream) != NULL)
+         while (fgets (tmp, sizeof tmp, stream) != NULL)
            if (strchr (tmp, '\n') != NULL)
              break;
        }
@@ -179,7 +168,6 @@ __glusterfs_fstab_getent (FILE *stream, struct 
glusterfs_mntent *mp,
     case 2:
       break;
     }
-  funlockfile (stream);
 
   return mp;
 }
diff --git a/libglusterfs/src/glusterfs_fstab.h 
b/libglusterfs/src/glusterfs_fstab.h
index 5d6c6a7..831ae7c 100644
--- a/libglusterfs/src/glusterfs_fstab.h
+++ b/libglusterfs/src/glusterfs_fstab.h
@@ -20,10 +20,6 @@
 #ifndef        GLUSTERFS_FSTAB_MNTENT_H
 #define        GLUSTERFS_FSTAB_MNTENT_H        1
 
-#include <features.h>
-#include <stdio.h>
-#include <paths.h>
-
 
 /* General filesystem types.  */
 #define GF_MNTTYPE_IGNORE      "ignore"        /* Ignore this entry.  */
-- 
1.6.2.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]