summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2005-07-24 10:53:28 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-07-24 10:53:28 +0000
commitca4cc9a110f90751a2a8ec7869c02a6b3cf72ff4 (patch)
tree62dae5911a687bc4c27e6d12912388f2295642af /net-misc/dhcpcd
parentadded media-libs/openexr:fltk (diff)
downloadgentoo-2-ca4cc9a110f90751a2a8ec7869c02a6b3cf72ff4.tar.gz
gentoo-2-ca4cc9a110f90751a2a8ec7869c02a6b3cf72ff4.tar.bz2
gentoo-2-ca4cc9a110f90751a2a8ec7869c02a6b3cf72ff4.zip
Fix building with gcc2.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'net-misc/dhcpcd')
-rw-r--r--net-misc/dhcpcd/ChangeLog6
-rw-r--r--net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild5
-rw-r--r--net-misc/dhcpcd/files/dhcpcd-1.3.22_p4-gcc2.patch84
3 files changed, 93 insertions, 2 deletions
diff --git a/net-misc/dhcpcd/ChangeLog b/net-misc/dhcpcd/ChangeLog
index 80dbbab031b1..0e8d8269ca2c 100644
--- a/net-misc/dhcpcd/ChangeLog
+++ b/net-misc/dhcpcd/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-misc/dhcpcd
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/ChangeLog,v 1.52 2005/07/12 12:19:38 spb Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/ChangeLog,v 1.53 2005/07/24 10:53:28 azarah Exp $
+
+ 24 Jul 2005; Martin Schlemmer <azarah@gentoo.org>
+ +files/dhcpcd-1.3.22_p4-gcc2.patch, dhcpcd-1.3.22_p4-r12.ebuild:
+ Fix building with gcc2.
12 Jul 2005; Stephen Bennett <spb@gentoo.org> dhcpcd-1.3.22_p4-r11.ebuild:
mips stable for #98394
diff --git a/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild b/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild
index 6fc1baabff59..ef13eed0abcb 100644
--- a/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild
+++ b/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild,v 1.1 2005/07/10 10:02:13 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-1.3.22_p4-r12.ebuild,v 1.2 2005/07/24 10:53:28 azarah Exp $
inherit flag-o-matic eutils
@@ -57,6 +57,9 @@ src_unpack() {
# Stop a possible DoS issue - fixes #98394
epatch "${FILESDIR}"/${P}-security.patch
+ # Fix compiling on gcc2
+ epatch "${FILESDIR}"/${P}-gcc2.patch
+
# Make sure we use paths from configure rather than hardcoded crap
sed -i \
-e '/^mandir/s:=.*:=@mandir@:' \
diff --git a/net-misc/dhcpcd/files/dhcpcd-1.3.22_p4-gcc2.patch b/net-misc/dhcpcd/files/dhcpcd-1.3.22_p4-gcc2.patch
new file mode 100644
index 000000000000..e62013fea3e0
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-1.3.22_p4-gcc2.patch
@@ -0,0 +1,84 @@
+--- dhcpcd-1.3.22-pl4/dhcpconfig.c 2005-07-24 12:51:33 +0200
++++ dhcpcd-1.3.22-pl4.az/dhcpconfig.c 2005-07-24 12:53:34 +0200
+@@ -382,8 +382,8 @@
+ f=fopen(resolv_file, "w");
+ if ( f )
+ {
+- fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ int i;
++ fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ if ( DhcpOptions.len[domainName] )
+ fprintf(f,"domain %s\n",(char *)DhcpOptions.val[domainName]);
+
+@@ -413,9 +413,9 @@
+ f=fopen(nis_file, "w");
+ if ( f )
+ {
+- fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ int i;
+ char *prefix=NULL;
++ fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ if ( DhcpOptions.len[nisDomainName] ) {
+ if ( DhcpOptions.len[nisServers] ) {
+ prefix=(char *)malloc(DhcpOptions.len[nisDomainName] + 15);
+@@ -447,8 +447,10 @@
+ f=fopen(ntp_file, "w");
+ if ( f )
+ {
+- fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ int net, mask;
++ int i;
++ char addr[4*3+3*1+1];
++ fprintf(f, "# Generated by dhcpcd for interface %s\n", IfName);
+ memcpy(&mask,DhcpOptions.val[subnetMask],4);
+ net = DhcpIface.ciaddr & mask;
+
+@@ -456,17 +458,15 @@
+ fprintf(f,"restrict default noquery notrust nomodify\n");
+ fprintf(f,"restrict 127.0.0.1\n");
+
+- int i;
+- char addr[4*3+3*1+1];
+- for (i=0;i<DhcpOptions.len[ntpServers];i+=4)
+- {
+- snprintf(addr,sizeof(addr),"%u.%u.%u.%u",
+- ((unsigned char *)DhcpOptions.val[ntpServers])[i],
+- ((unsigned char *)DhcpOptions.val[ntpServers])[i+1],
+- ((unsigned char *)DhcpOptions.val[ntpServers])[i+2],
+- ((unsigned char *)DhcpOptions.val[ntpServers])[i+3]);
+- fprintf(f,"restrict %s nomodify notrap noquery\nserver %s\n",addr,addr);
+- }
++ for (i=0;i<DhcpOptions.len[ntpServers];i+=4)
++ {
++ snprintf(addr,sizeof(addr),"%u.%u.%u.%u",
++ ((unsigned char *)DhcpOptions.val[ntpServers])[i],
++ ((unsigned char *)DhcpOptions.val[ntpServers])[i+1],
++ ((unsigned char *)DhcpOptions.val[ntpServers])[i+2],
++ ((unsigned char *)DhcpOptions.val[ntpServers])[i+3]);
++ fprintf(f,"restrict %s nomodify notrap noquery\nserver %s\n",addr,addr);
++ }
+
+ fprintf(f, "driftfile /var/lib/ntp/ntp.drift\n");
+ fprintf(f, "logfile /var/log/ntp.log\n");
+--- dhcpcd-1.3.22-pl4/dhcpcd.c 2005-07-24 12:53:57 +0200
++++ dhcpcd-1.3.22-pl4.az/dhcpcd.c 2005-07-24 12:55:42 +0200
+@@ -146,6 +146,8 @@
+ if ( argc[i][0]=='-' )
+ prgs: switch ( argc[i][s] )
+ {
++ char *tmp;
++ long m;
+ case 0:
+ i++;
+ s=1;
+@@ -158,9 +160,8 @@
+ if ( argc[i][s+1] ) goto usage;
+ i++;
+ if ( ! argc[i] ) goto usage;
+- char *tmp;
+ errno = 0;
+- long m=strtol(argc[i], &tmp, 0);
++ m=strtol(argc[i], &tmp, 0);
+ if (argc[i][0] == '\0' || *tmp != '\0' ) goto usage;
+ if ((errno == ERANGE &&
+ (m == LONG_MAX || m == LONG_MIN )) ||