summaryrefslogtreecommitdiff
path: root/gutils.c
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>1999-04-22 13:16:10 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>1999-04-22 13:16:10 +0000
commit737d9c6714ed46e04edfcfee63aaf41e0426cc87 (patch)
tree3025e9f662da904d0bf020a9aac116f7b5670d7d /gutils.c
parent68b24cb4a8f880f13b5cfae2efd0a38a50248931 (diff)
downloadglib-737d9c6714ed46e04edfcfee63aaf41e0426cc87.tar.gz
use sysconf (_SC_GETPW_R_SIZE_MAX) as the new initinal bufsize for
1999-04-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * 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 <H.Duerer@zait.uni-bremen.de>.
Diffstat (limited to 'gutils.c')
-rw-r--r--gutils.c5
1 files changed, 5 insertions, 0 deletions
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