From 1ed6997670c0b102395eae56d13d630714a07e99 Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Mon, 1 Mar 1999 07:55:34 +0000 Subject: [PATCH] Fixed yet another bloody implementation of getpwuid_r. This time for AIX. 1999-03-01 Sebastian Wilhelmi * gutils.c (g_get_any_init): Fixed yet another bloody implementation of getpwuid_r. This time for AIX. Thanks to Olaf Dietsche . I would like a configure test better than that, but have no idea, how to do that easily. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ glib/gutils.c | 7 ++++++- gutils.c | 7 ++++++- 10 files changed, 68 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 238e89a..781ad10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 238e89a..781ad10 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +1999-03-01 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): Fixed yet another bloody + implementation of getpwuid_r on AIX. Thanks to Olaf Dietsche + . 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 * ChangeLog: moved old ChangeLog to ChangeLog.pre-1-2, and started diff --git a/glib/gutils.c b/glib/gutils.c index 9d42344..b361814 100644 --- a/glib/gutils.c +++ b/glib/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) diff --git a/gutils.c b/gutils.c index 9d42344..b361814 100644 --- 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) -- 2.7.4