Handle failure of sysconf and pick a fixed size buffer. (Happens on Cygwin
authorOwen Taylor <otaylor@redhat.com>
Wed, 19 Sep 2001 16:52:20 +0000 (16:52 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 19 Sep 2001 16:52:20 +0000 (16:52 +0000)
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)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gutils.c

index 057a98a..fb5964c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index 057a98a..fb5964c 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Wed Sep 19 11:23:41 2001  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in: Error out if gettext support is not found. (#59386)
index fd8458b..a9048ac 100644 (file)
@@ -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
           {