From 253d4c8ad22b31b3490e8b6be3e34c584994ec6b Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Sat, 19 Apr 2003 10:15:29 +0000 Subject: getpw*_r is now implemented in -CURRENT. However, the _SC_GETPW_R_SIZE_MAX sysconf is not. This causes glib to try and malloc UINT_MAX bytes of memeory which basically translates to -1 bytes. Sanity check the value returned by sysconf (_SC_GETPW_R_SIZE_MAX) to see that it's really implemented. This fixes an abort people started to see in Glib-based applications. Reported by: Shin-ichi YOSHIMOTO --- devel/glib12/Makefile | 2 +- devel/glib12/files/patch-gutils.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 devel/glib12/files/patch-gutils.c (limited to 'devel/glib12') diff --git a/devel/glib12/Makefile b/devel/glib12/Makefile index a780d2d395bd..333c91a62e89 100644 --- a/devel/glib12/Makefile +++ b/devel/glib12/Makefile @@ -7,7 +7,7 @@ PORTNAME= glib PORTVERSION= 1.2.10 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/glib/1.2 diff --git a/devel/glib12/files/patch-gutils.c b/devel/glib12/files/patch-gutils.c new file mode 100644 index 000000000000..fab2a547801d --- /dev/null +++ b/devel/glib12/files/patch-gutils.c @@ -0,0 +1,10 @@ +--- gutils.c.orig Wed Aug 9 14:12:31 2000 ++++ gutils.c Sat Apr 19 06:09:28 2003 +@@ -483,6 +483,7 @@ + # ifdef _SC_GETPW_R_SIZE_MAX + /* This reurns the maximum length */ + guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX); ++ if (bufsize == UINT_MAX) bufsize = 64; /* XXX Correct for unimpelemented SC */ + # else /* _SC_GETPW_R_SIZE_MAX */ + guint bufsize = 64; + # endif /* _SC_GETPW_R_SIZE_MAX */ -- cgit v1.2.3