fixed Solaris 11 build

Tue, 09 Feb 2016 22:53:59 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 09 Feb 2016 22:53:59 +0100
changeset 113
57e706fed20a
parent 112
b962d83124bc
child 114
c3a0f1275d71

fixed Solaris 11 build

make/solaris.mk file | annotate | diff | comparison | revisions
make/suncc.mk file | annotate | diff | comparison | revisions
src/server/util/util.c file | annotate | diff | comparison | revisions
--- a/make/solaris.mk	Tue Nov 10 21:18:51 2015 +0100
+++ b/make/solaris.mk	Tue Feb 09 22:53:59 2016 +0100
@@ -28,7 +28,7 @@
 
 
 # compiler and linker flags
-CFLAGS += -DSOLARIS
+CFLAGS += -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
 LDFLAGS += -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lldap
 
 #PLUGINS = java
--- a/make/suncc.mk	Tue Nov 10 21:18:51 2015 +0100
+++ b/make/suncc.mk	Tue Feb 09 22:53:59 2016 +0100
@@ -26,7 +26,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-CFLAGS += -xc99 -g -D_REENTRANT
+CFLAGS += -xc99 -g
 LDFLAGS += -Wl,-R,'$$ORIGIN/../lib'
 
 CC  = cc
--- a/src/server/util/util.c	Tue Nov 10 21:18:51 2015 +0100
+++ b/src/server/util/util.c	Tue Feb 09 22:53:59 2016 +0100
@@ -428,13 +428,9 @@
 {
     struct passwd *rv;
 
-#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(BSD)
     errno = getpwnam_r(name, result, buffer, buflen, &rv);
     if (errno != 0)
         rv = NULL;
-#else
-    rv = getpwnam_r(name, result, buffer, buflen);
-#endif
 
     return rv;
 }
@@ -447,13 +443,9 @@
 {
     struct passwd *rv;
 
-#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(BSD)
     errno = getpwuid_r(uid, result, buffer, buflen, &rv);
     if (errno != 0)
         rv = NULL;
-#else
-    rv = getpwuid_r(uid, result, buffer, buflen);
-#endif
 
     return rv;
 }
@@ -484,7 +476,11 @@
     sstr_t child = sstr(ch);
     sstr_t newstr;
     sstr_t s;
-    
+    if(parent.ptr[parent.length-1] == '/') {
+        s.length = 0;
+    } else {
+        s = S("/");
+    }
     
     UcxAllocator a = util_pool_allocator(pool); 
     if(s.length == 1) {

mercurial