mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 01:57:14 +02:00
Use sysconf (_SC_GETPW_R_SIZE_MAX) for initial bufsize, where available.
2000-05-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gutils.c (g_get_any_init): Use sysconf (_SC_GETPW_R_SIZE_MAX) for initial bufsize, where available. This is already in GLib 1.3.
This commit is contained in:
committed by
Sebastian Wilhelmi
parent
9cf514b198
commit
d79c9740fa
5
gutils.c
5
gutils.c
@@ -480,7 +480,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
|
||||
|
Reference in New Issue
Block a user