[SM-Commit] GIT changes to master grimoire by George Sherwood (2ee9711c30485cae003d3cae418189d42871ec00)

George Sherwood scm at sourcemage.org
Thu Mar 26 23:25:56 EDT 2009


GIT changes to master grimoire by George Sherwood <gsherwood at sourcemage.org>:

 ftp/netkit-ftp/HISTORY        |    4 +++
 ftp/netkit-ftp/PRE_BUILD      |    3 ++
 ftp/netkit-ftp/ftp-glob.patch |   55 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)

New commits:
commit 2ee9711c30485cae003d3cae418189d42871ec00
Author: George Sherwood <gsherwood at sourcemage.org>
Commit: George Sherwood <gsherwood at sourcemage.org>

    netkit-ftp: Added fedora patch to fix issue with glibc >= 2.8

diff --git a/ftp/netkit-ftp/HISTORY b/ftp/netkit-ftp/HISTORY
index 82aa540..c7b2cbc 100644
--- a/ftp/netkit-ftp/HISTORY
+++ b/ftp/netkit-ftp/HISTORY
@@ -1,3 +1,7 @@
+2009-03-26 George Sherwood <gsherwood at sourcemage.org>
+	* PRE_BUILD: Added to apply patch
+	* ftp-glob.patch: Added fedora patch to fix build with glibc >= 2.8
+
 2006-09-21 Juuso Alasuutari <iuso at sourcemage.org>
 	* DETAILS: [automated] Removed BUILD_API=2.
 
diff --git a/ftp/netkit-ftp/PRE_BUILD b/ftp/netkit-ftp/PRE_BUILD
new file mode 100755
index 0000000..ab97297
--- /dev/null
+++ b/ftp/netkit-ftp/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+patch -p0 < $SPELL_DIRECTORY/ftp-glob.patch
diff --git a/ftp/netkit-ftp/ftp-glob.patch b/ftp/netkit-ftp/ftp-glob.patch
new file mode 100644
index 0000000..e7e51d3
--- /dev/null
+++ b/ftp/netkit-ftp/ftp-glob.patch
@@ -0,0 +1,55 @@
+diff -up ftp/glob.c.arg_max ftp/glob.c
+--- ftp/glob.c.arg_max	2008-04-07 11:41:14.000000000 +0200
++++ ftp/glob.c	2008-04-07 12:01:53.000000000 +0200
+@@ -50,6 +50,7 @@ char glob_rcsid[] = 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ 
+ #include "ftp_var.h"  /* for protos only */
+ #include "glob.h"
+@@ -57,7 +58,7 @@ char glob_rcsid[] = 
+ #define	QUOTE 0200
+ #define	TRIM 0177
+ #define	eq(a,b)		(strcmp(a, b)==0)
+-#define	GAVSIZ		(ARG_MAX/6)
++#define	GAVSIZ		(sysconf(_SC_ARG_MAX)/6)
+ #define	isdir(d)	((d.st_mode & S_IFMT) == S_IFDIR)
+ 
+ const char *globerr;
+@@ -115,7 +116,7 @@ char **
+ ftpglob(const char *v)
+ {
+ 	char agpath[BUFSIZ];
+-	entry agargv[GAVSIZ];
++	entry *agargv;
+ 	centry vv[2];
+ 	vv[0].text = v;
+ 	vv[1].text = NULL;
+@@ -133,6 +134,8 @@ ftpglob(const char *v)
+ 	/* added ()'s to sizeof, (ambigious math for the compiler) */
+ 	lastgpathp = agpath + (sizeof(agpath)- 2);
+ 
++	agargv = (entry *)malloc(sizeof (entry) * GAVSIZ);
++	if (agargv == NULL) fatal("Out of memory");
+ 	ginit(agargv); 
+ 	globcnt = 0;
+ 	collect(v);
+@@ -156,7 +159,7 @@ ginit(entry *agargv)
+ 	gargv = agargv; 
+ 	sortbas = agargv; 
+ 	gargc = 0;
+-	gnleft = ARG_MAX - 4;
++	gnleft = sysconf(_SC_ARG_MAX) - 4;
+ }
+ 
+ static 
+@@ -674,6 +677,7 @@ efree(entry *av) 
+ {
+     int i;
+     for (i=0; av[i].text; i++) free(av[i].text);
++    free((void *)av);
+ }
+ 
+ static



More information about the SM-Commit mailing list