summaryrefslogtreecommitdiffstats
path: root/patches/netkit-ftp-0.17/netkit-ftp-0.17-glibc28.diff
blob: 9b3bf7a2a28ae236f24a3b85c857af0d0fec0c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: [patch] ARG_MAX undefined in newer glibcs

When building with newer glibc versions >= 2.8, we get this error:

glob.c: In function 'ftpglob':
glob.c:118: error: 'ARG_MAX' undeclared (first use in this function)

Use the solution suggested here:
http://www.nabble.com/FYI:--glibc-2.8-may-break-some-of-your-packages-td16625128.html

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>

---
 ftp/glob.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: netkit-ftp-0.17/ftp/glob.c
===================================================================
--- netkit-ftp-0.17.orig/ftp/glob.c
+++ netkit-ftp-0.17/ftp/glob.c
@@ -51,9 +51,18 @@ char glob_rcsid[] = 
 #include <stdlib.h>
 #include <string.h>
 
+#include <unistd.h>
+
 #include "ftp_var.h"  /* for protos only */
 #include "glob.h"
 
+#if defined(_SC_ARG_MAX)
+# if defined(ARG_MAX)
+#    undef ARG_MAX
+# endif
+# define ARG_MAX sysconf (_SC_ARG_MAX)
+#endif
+
 #define	QUOTE 0200
 #define	TRIM 0177
 #define	eq(a,b)		(strcmp(a, b)==0)