1 |
vapier 08/06/28 15:40:26 |
2 |
|
3 |
Added: netkit-ftp-0.17-arg_max.patch |
4 |
Log: |
5 |
Fix from Fedora for building with glibc-2.8 #226513 by Peter. |
6 |
(Portage version: 2.2_rc1/cvs/Linux 2.6.25 x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-ftp/ftp/files/netkit-ftp-0.17-arg_max.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-ftp/ftp/files/netkit-ftp-0.17-arg_max.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-ftp/ftp/files/netkit-ftp-0.17-arg_max.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: netkit-ftp-0.17-arg_max.patch |
15 |
=================================================================== |
16 |
diff -up netkit-ftp-0.17/ftp/glob.c.arg_max netkit-ftp-0.17/ftp/glob.c |
17 |
--- netkit-ftp-0.17/ftp/glob.c.arg_max 2008-04-07 11:41:14.000000000 +0200 |
18 |
+++ netkit-ftp-0.17/ftp/glob.c 2008-04-07 12:01:53.000000000 +0200 |
19 |
@@ -50,6 +50,7 @@ char glob_rcsid[] = |
20 |
#include <stdio.h> |
21 |
#include <stdlib.h> |
22 |
#include <string.h> |
23 |
+#include <unistd.h> |
24 |
|
25 |
#include "ftp_var.h" /* for protos only */ |
26 |
#include "glob.h" |
27 |
@@ -57,7 +58,7 @@ char glob_rcsid[] = |
28 |
#define QUOTE 0200 |
29 |
#define TRIM 0177 |
30 |
#define eq(a,b) (strcmp(a, b)==0) |
31 |
-#define GAVSIZ (ARG_MAX/6) |
32 |
+#define GAVSIZ (sysconf(_SC_ARG_MAX)/6) |
33 |
#define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) |
34 |
|
35 |
const char *globerr; |
36 |
@@ -115,7 +116,7 @@ char ** |
37 |
ftpglob(const char *v) |
38 |
{ |
39 |
char agpath[BUFSIZ]; |
40 |
- entry agargv[GAVSIZ]; |
41 |
+ entry *agargv; |
42 |
centry vv[2]; |
43 |
vv[0].text = v; |
44 |
vv[1].text = NULL; |
45 |
@@ -133,6 +134,8 @@ ftpglob(const char *v) |
46 |
/* added ()'s to sizeof, (ambigious math for the compiler) */ |
47 |
lastgpathp = agpath + (sizeof(agpath)- 2); |
48 |
|
49 |
+ agargv = (entry *)malloc(sizeof (entry) * GAVSIZ); |
50 |
+ if (agargv == NULL) fatal("Out of memory"); |
51 |
ginit(agargv); |
52 |
globcnt = 0; |
53 |
collect(v); |
54 |
@@ -156,7 +159,7 @@ ginit(entry *agargv) |
55 |
gargv = agargv; |
56 |
sortbas = agargv; |
57 |
gargc = 0; |
58 |
- gnleft = ARG_MAX - 4; |
59 |
+ gnleft = sysconf(_SC_ARG_MAX) - 4; |
60 |
} |
61 |
|
62 |
static |
63 |
@@ -674,6 +677,7 @@ efree(entry *av) |
64 |
{ |
65 |
int i; |
66 |
for (i=0; av[i].text; i++) free(av[i].text); |
67 |
+ free((void *)av); |
68 |
} |
69 |
|
70 |
static |
71 |
|
72 |
|
73 |
|
74 |
-- |
75 |
gentoo-commits@l.g.o mailing list |