Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2004 23:49:32 +1000
From:      Kiyo Kelvin Lee <kiyo@pacific.net.au>
To:        ports@freebsd.org
Subject:   socks5-1.0.11_3 failed to compile and install rftp and rtelnetproperly, PATCHES INCLUDED!
Message-ID:  <40A22B6C.6020905@pacific.net.au>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040301050103080409040605
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

For FreeBSD 5.2.1 with gcc 3.3.3, socks5-1.0.11_3 failed to compile and 
install rftp and rtelnet properly.
Basically, the problem is that varargs.h is no longer useful for gcc 3.3.3.
So the attached patches can be used to fix the files: clients/ftp/ftp.c, 
clients/telnet/telnet.c, clients/telnet/commands.c to use stdarg.h instead.
Regards,
Kiyo

--------------040301050103080409040605
Content-Type: text/plain;
 name="patch-bc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-bc"

--- clients/telnet/commands.c.orig	Thu Aug 17 01:38:46 2000
+++ clients/telnet/commands.c	Wed May 12 23:14:53 2004
@@ -83,9 +83,14 @@
 #include <signal.h>
 #include <ctype.h>
 #include <pwd.h>
-#include <varargs.h>
 #include <errno.h>
 
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
 #include <arpa/telnet.h>
 
 #include "general.h"
@@ -122,7 +127,13 @@
 extern int Ambiguous();
 extern void herror();
 
+typedef int (*intrtn_t)();
+
+#ifdef HAVE_STDARG_H
+static int call(intrtn_t routine, ...);
+#else
 static int call();
+#endif
 
 typedef struct {
     char *name;		/* command name */
@@ -2092,17 +2103,26 @@
 
     /*VARARGS1*/
     static int
-call(va_alist)
-    va_dcl
+call
+#ifdef HAVE_STDARG_H
+(intrtn_t routine, ...)
+#else
+(va_alist) va_dcl
+#endif
 {
     va_list ap;
-    typedef int (*intrtn_t)();
+#ifndef HAVE_STDARG_H
     intrtn_t routine;
+#endif
     char *args[100];
     int argno = 0;
 
+#ifdef HAVE_STDARG_H
+    va_start(ap, routine);
+#else
     va_start(ap);
     routine = (va_arg(ap, intrtn_t));
+#endif
     while ((args[argno++] = va_arg(ap, char *)) != 0) {
 	;
     }

--------------040301050103080409040605
Content-Type: text/plain;
 name="patch-bb"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-bb"

--- clients/telnet/telnet.c.orig	Thu Aug 17 01:38:48 2000
+++ clients/telnet/telnet.c	Wed May 12 23:13:16 2004
@@ -179,18 +179,34 @@
 
 
 #ifdef	notdef
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 
 /*VARARGS*/
-static void printring(va_alist) va_dcl {
+static void
+printring
+#ifdef HAVE_STDARG_H
+(Ring *ring, ...)
+#else
+(va_alist) va_dcl
+#endif
+{
     char buffer[100], char *ptr, char *format, char *string;
+#ifndef HAVE_STDARG_H
     Ring *ring;
+#endif
     va_list ap;
     int i;
 
+#ifdef HAVE_STDARG_H
+    va_start(ap, ring);
+#else
     va_start(ap);
-
     ring   = va_arg(ap, Ring *);
+#endif
     format = va_arg(ap, char *);
     ptr    = buffer;
 
@@ -219,6 +235,8 @@
 	}
     }
     ring_supply_data(ring, buffer, ptr-buffer);
+
+    va_end(ap);
 }
 #endif
 

--------------040301050103080409040605
Content-Type: text/plain;
 name="patch-ba"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-ba"

--- clients/ftp/ftp.c.orig	Thu Aug 17 01:38:44 2000
+++ clients/ftp/ftp.c	Wed May 12 23:10:49 2004
@@ -48,7 +48,11 @@
 #include <fcntl.h>
 #endif
 
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 
 #ifdef FASCIST
 #include <syslog.h>
@@ -241,9 +245,18 @@
 }
 
 /*VARARGS*/
-int command(va_alist) va_dcl {
+int
+command
+#ifdef HAVE_STDARG_H
+(const char *fmt, ...)
+#else
+(va_alist) va_dcl
+#endif
+{
     va_list ap;
+#ifndef HAVE_STDARG_H
     char *fmt;
+#endif
     int r;
     Sig_t oldintr;
     
@@ -251,8 +264,12 @@
     if (debug) {
 	printf("---> ");
 
+#ifdef HAVE_STDARG_H
+        va_start(ap, fmt);
+#else
 	va_start(ap);
 	fmt = va_arg(ap, char *);
+#endif
 	if (strncmp("PASS ", fmt, 5) == 0)
 	    printf("PASS XXXX");
 	else 
@@ -271,8 +288,12 @@
 
     oldintr = Signal(SIGINT, cmdabort);
 
+#ifdef HAVE_STDARG_H
+    va_start(ap, fmt);
+#else
     va_start(ap);
     fmt = va_arg(ap, char *);
+#endif
     vfprintf(cout, fmt, ap);
     va_end(ap);
 

--------------040301050103080409040605--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40A22B6C.6020905>