rpms/ftp/devel netkit-ftp-0.17-arg_max.patch, NONE, 1.1 ftp.spec, 1.45, 1.46
Martin Nagy (mnagy)
fedora-extras-commits at redhat.com
Mon Apr 7 10:52:53 UTC 2008
Author: mnagy
Update of /cvs/extras/rpms/ftp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv674
Modified Files:
ftp.spec
Added Files:
netkit-ftp-0.17-arg_max.patch
Log Message:
* Mon Apr 07 2008 Martin Nagy <mnagy at redhat.com> - 0.17-47
- Use sysconf to get ARG_MAX instead of a macro (#440782)
netkit-ftp-0.17-arg_max.patch:
--- NEW FILE netkit-ftp-0.17-arg_max.patch ---
diff -up netkit-ftp-0.17/ftp/glob.c.arg_max netkit-ftp-0.17/ftp/glob.c
--- netkit-ftp-0.17/ftp/glob.c.arg_max 2008-04-07 11:41:14.000000000 +0200
+++ netkit-ftp-0.17/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
Index: ftp.spec
===================================================================
RCS file: /cvs/extras/rpms/ftp/devel/ftp.spec,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- ftp.spec 19 Feb 2008 14:26:52 -0000 1.45
+++ ftp.spec 7 Apr 2008 10:52:13 -0000 1.46
@@ -1,7 +1,7 @@
Summary: The standard UNIX FTP (File Transfer Protocol) client
Name: ftp
Version: 0.17
-Release: 46%{?dist}
+Release: 47%{?dist}
License: BSD with advertising
Group: Applications/Internet
Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-ftp-%{version}.tar.gz
@@ -28,6 +28,7 @@
Patch20: netkit-ftp-0.17-fdleak.patch
Patch21: netkit-ftp-0.17-fprintf.patch
Patch22: netkit-ftp-0.17-bitrate.patch
+Patch23: netkit-ftp-0.17-arg_max.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glibc-devel, readline-devel, ncurses-devel
@@ -64,6 +65,7 @@
%patch20 -p1 -b .fdleak
%patch21 -p1 -b .fprintf
%patch22 -p1 -b .bitrate
+%patch23 -p1 -b .arg_max
%build
sh configure --with-c-compiler=gcc --enable-ipv6
@@ -97,6 +99,9 @@
%{_mandir}/man5/netrc.*
%changelog
+* Mon Apr 07 2008 Martin Nagy <mnagy at redhat.com> - 0.17-47
+- Use sysconf to get ARG_MAX instead of a macro (#440782)
+
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.17-46
- Autorebuild for GCC 4.3
More information about the fedora-extras-commits
mailing list