mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-25 03:17:52 +02:00
Handle failure of sysconf and pick a fixed size buffer. (Happens on Cygwin
Wed Sep 19 12:49:11 2001 Owen Taylor <otaylor@redhat.com> * glib/gutils.c (g_get_any_init): Handle failure of sysconf and pick a fixed size buffer. (Happens on Cygwin #60242)
This commit is contained in:
@@ -822,16 +822,19 @@ g_get_any_init (void)
|
||||
{
|
||||
struct passwd *pw = NULL;
|
||||
gpointer buffer = NULL;
|
||||
gint error;
|
||||
|
||||
# if defined (HAVE_POSIX_GETPWUID_R) || defined (HAVE_NONPOSIX_GETPWUID_R)
|
||||
struct passwd pwd;
|
||||
# ifdef _SC_GETPW_R_SIZE_MAX
|
||||
/* This reurns the maximum length */
|
||||
glong bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
|
||||
glong bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
|
||||
|
||||
if (bufsize < 0)
|
||||
bufsize = 64;
|
||||
# else /* _SC_GETPW_R_SIZE_MAX */
|
||||
glong bufsize = 64;
|
||||
# endif /* _SC_GETPW_R_SIZE_MAX */
|
||||
gint error;
|
||||
|
||||
do
|
||||
{
|
||||
|
Reference in New Issue
Block a user