Fixed yet another bloody implementation of getpwuid_r. This time for AIX.
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Mon, 1 Mar 1999 07:55:34 +0000 (07:55 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Mon, 1 Mar 1999 07:55:34 +0000 (07:55 +0000)
1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* gutils.c (g_get_any_init): Fixed yet another bloody
implementation of getpwuid_r. This time for AIX. Thanks to Olaf
Dietsche <olaf.dietsche+list.gtk@netcologne.de>. I would like a
configure test better than that, but have no idea, how to do that
easily.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gutils.c
gutils.c

index 238e89a..781ad10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 238e89a..781ad10 100644 (file)
@@ -1,3 +1,10 @@
+1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gutils.c (g_get_any_init): Fixed yet another bloody
+       implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche
+       <olaf.dietsche+list.gtk@netcologne.de>. I would like a configure
+       test better than that, but have no idea, how to do that easily.
+
 Sat Feb 27 01:18:47 1999  Tim Janik  <timj@gtk.org>
 
        * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started
index 9d42344..b361814 100644 (file)
@@ -462,11 +462,16 @@ g_get_any_init (void)
            errno = 0;
            
 #    ifdef HAVE_GETPWUID_R_POSIX
-            error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
+           error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
             error = error < 0 ? errno : error;
 #    else /* !HAVE_GETPWUID_R_POSIX */
+#      ifdef _AIX
+           error = getpwuid_r (getuid (), &pwd, buffer, bufsize);
+           pw = error == 0 ? &pwd : NULL;
+#      else /* !_AIX */
             pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
             error = pw ? 0 : errno;
+#      endif /* !_AIX */            
 #    endif /* !HAVE_GETPWUID_R_POSIX */
            
            if (!pw)
index 9d42344..b361814 100644 (file)
--- a/gutils.c
+++ b/gutils.c
@@ -462,11 +462,16 @@ g_get_any_init (void)
            errno = 0;
            
 #    ifdef HAVE_GETPWUID_R_POSIX
-            error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
+           error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
             error = error < 0 ? errno : error;
 #    else /* !HAVE_GETPWUID_R_POSIX */
+#      ifdef _AIX
+           error = getpwuid_r (getuid (), &pwd, buffer, bufsize);
+           pw = error == 0 ? &pwd : NULL;
+#      else /* !_AIX */
             pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
             error = pw ? 0 : errno;
+#      endif /* !_AIX */            
 #    endif /* !HAVE_GETPWUID_R_POSIX */
            
            if (!pw)