From 737d9c6714ed46e04edfcfee63aaf41e0426cc87 Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Thu, 22 Apr 1999 13:16:10 +0000 Subject: [PATCH] use sysconf (_SC_GETPW_R_SIZE_MAX) as the new initinal bufsize for 1999-04-22 Sebastian Wilhelmi * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as the new initinal bufsize for getpwuid_r on systems, that support this. Hint from Holger Duerer . --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/gutils.c | 5 +++++ gutils.c | 5 +++++ 10 files changed, 58 insertions(+) diff --git a/ChangeLog b/ChangeLog index b07bb2805..dc6b075fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b07bb2805..dc6b075fd 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +1999-04-22 Sebastian Wilhelmi + + * gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as + the new initinal bufsize for getpwuid_r on systems, that support + this. Hint from Holger Duerer . + Sat Apr 17 20:55:13 BST 1999 Tony Gale * glib.h, gstring.c: Add new g_string functions for reading diff --git a/glib/gutils.c b/glib/gutils.c index 5ac16ed10..ff202f710 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -452,7 +452,12 @@ g_get_any_init (void) # ifdef HAVE_GETPWUID_R struct passwd pwd; +# ifdef _SC_GETPW_R_SIZE_MAX + /* This reurns the maximum length */ + guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX); +# else /* _SC_GETPW_R_SIZE_MAX */ guint bufsize = 64; +# endif /* _SC_GETPW_R_SIZE_MAX */ gint error; do diff --git a/gutils.c b/gutils.c index 5ac16ed10..ff202f710 100644 --- a/gutils.c +++ b/gutils.c @@ -452,7 +452,12 @@ g_get_any_init (void) # ifdef HAVE_GETPWUID_R struct passwd pwd; +# ifdef _SC_GETPW_R_SIZE_MAX + /* This reurns the maximum length */ + guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX); +# else /* _SC_GETPW_R_SIZE_MAX */ guint bufsize = 64; +# endif /* _SC_GETPW_R_SIZE_MAX */ gint error; do