summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-06-23 22:48:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-06-23 22:48:46 +0000
commitd1c4681a41ebee11901ef30b928d94f1ccbb82d6 (patch)
treed1d137b6d550f3da96f368662f8e2f001ee620f7
parent01672c3384db5b63dc5148f295f0c0381ffa0387 (diff)
remove evil #ifdef __GNUC__ garbage to avoid longjmp clobbering and use volatile instead
-rw-r--r--usr.bin/ftp/fetch.c19
-rw-r--r--usr.bin/ftp/ftp.c50
-rw-r--r--usr.bin/ftp/main.c15
3 files changed, 24 insertions, 60 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index bc307e5f862..333221c2a72 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.33 2000/06/30 16:00:15 millert Exp $ */
+/* $OpenBSD: fetch.c,v 1.34 2001/06/23 22:48:44 millert Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.33 2000/06/30 16:00:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.34 2001/06/23 22:48:44 millert Exp $";
#endif /* not lint */
/*
@@ -98,13 +98,14 @@ url_get(origline, proxyenv, outfile)
{
struct addrinfo hints, *res0, *res;
int error;
- int i, out, isftpurl, isfileurl;
- volatile int s;
+ int i, isftpurl, isfileurl;
+ volatile int s, out;
size_t len;
char c, *cp, *ep, *portnum, *path, buf[4096];
char pbuf[NI_MAXSERV];
- const char *savefile;
- char *line, *proxy, *host, *port;
+ const char * volatile savefile;
+ char *line, *host, *port;
+ char * volatile proxy;
char *hosttail;
volatile sig_t oldintr;
off_t hashbytes;
@@ -115,12 +116,6 @@ url_get(origline, proxyenv, outfile)
isftpurl = 0;
isfileurl = 0;
-#ifdef __GNUC__ /* XXX: to shut up gcc warnings */
- (void)&out;
- (void)&proxy;
- (void)&savefile;
-#endif
-
line = strdup(origline);
if (line == NULL)
errx(1, "Can't allocate memory to parse URL");
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 1d3ee791e05..46795071279 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.39 2000/10/18 06:53:24 itojun Exp $ */
+/* $OpenBSD: ftp.c,v 1.40 2001/06/23 22:48:44 millert Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-static char rcsid[] = "$OpenBSD: ftp.c,v 1.39 2000/10/18 06:53:24 itojun Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.40 2001/06/23 22:48:44 millert Exp $";
#endif
#endif /* not lint */
@@ -507,23 +507,14 @@ sendrequest(cmd, local, remote, printnames)
{
struct stat st;
int c, d;
- FILE *fin, *dout;
- int (*closefunc) __P((FILE *));
- sig_t oldinti, oldintr, oldintp;
+ FILE * volatile fin, * volatile dout;
+ int (* volatile closefunc) __P((FILE *));
+ volatile sig_t oldinti, oldintr, oldintp;
volatile off_t hashbytes;
- char *lmode, buf[BUFSIZ], *bufp;
+ char * volatile lmode;
+ char buf[BUFSIZ], *bufp;
int oprogress;
-#ifdef __GNUC__ /* XXX: to shut up gcc warnings */
- (void)&fin;
- (void)&dout;
- (void)&closefunc;
- (void)&oldinti;
- (void)&oldintr;
- (void)&oldintp;
- (void)&lmode;
-#endif
-
hashbytes = mark;
direction = "sent";
dout = NULL;
@@ -806,12 +797,12 @@ abortrecv(notused)
void
recvrequest(cmd, local, remote, lmode, printnames, ignorespecial)
- const char *cmd, *local, *remote, *lmode;
+ const char *cmd, * volatile local, *remote, *lmode;
int printnames, ignorespecial;
{
- FILE *fout, *din;
- int (*closefunc) __P((FILE *));
- sig_t oldinti, oldintr, oldintp;
+ FILE * volatile fout, * volatile din;
+ int (* volatile closefunc) __P((FILE *));
+ volatile sig_t oldinti, oldintr, oldintp;
int c, d;
volatile int is_retr, tcrflag, bare_lfs;
static size_t bufsize;
@@ -822,16 +813,6 @@ recvrequest(cmd, local, remote, lmode, printnames, ignorespecial)
int oprogress;
int opreserve;
-#ifdef __GNUC__ /* XXX: to shut up gcc warnings */
- (void)&local;
- (void)&fout;
- (void)&din;
- (void)&closefunc;
- (void)&oldinti;
- (void)&oldintr;
- (void)&oldintp;
-#endif
-
fout = NULL;
din = NULL;
oldinti = NULL;
@@ -1723,17 +1704,12 @@ void
proxtrans(cmd, local, remote)
const char *cmd, *local, *remote;
{
- sig_t oldintr;
+ volatile sig_t oldintr;
int prox_type, nfnd;
volatile int secndflag;
- char *cmd2;
+ char * volatile cmd2;
fd_set mask;
-#ifdef __GNUC__ /* XXX: to shut up gcc warnings */
- (void)&oldintr;
- (void)&cmd2;
-#endif
-
oldintr = NULL;
secndflag = 0;
if (strcmp(cmd, "RETR"))
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 5361a56b58e..2bb149ce1f0 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.47 2000/06/21 19:22:54 itojun Exp $ */
+/* $OpenBSD: main.c,v 1.48 2001/06/23 22:48:45 millert Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -73,7 +73,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.47 2000/06/21 19:22:54 itojun Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.48 2001/06/23 22:48:45 millert Exp $";
#endif
#endif /* not lint */
@@ -95,12 +95,10 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.47 2000/06/21 19:22:54 itojun Exp $"
#include "ftp_var.h"
-int main __P((int, char **));
-
int
main(argc, argv)
- int argc;
- char *argv[];
+ volatile int argc;
+ char ** volatile argv;
{
int ch, top, rval;
struct passwd *pw = NULL;
@@ -282,11 +280,6 @@ main(argc, argv)
setttywidth(0);
(void)signal(SIGWINCH, setttywidth);
-#ifdef __GNUC__ /* XXX: to shut up gcc warnings */
- (void)&argc;
- (void)&argv;
-#endif
-
if (argc > 0) {
if (isurl(argv[0])) {
anonftp = 1; /* Handle "automatic" transfers. */