From 9327c26477c72aa50a76e748681bed25a1e9af56 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Mon, 13 May 1996 02:18:42 +0000 Subject: [PATCH] Fix for UNICOS. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@538 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/ftp.c | 9 +++++++-- appl/ftp/ftp/ftp_locl.h | 3 +++ appl/ftp/ftp/main.c | 7 ++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/appl/ftp/ftp/ftp.c b/appl/ftp/ftp/ftp.c index c1a99976b..d4e0bdbe8 100644 --- a/appl/ftp/ftp/ftp.c +++ b/appl/ftp/ftp/ftp.c @@ -1093,6 +1093,9 @@ initconn(void) int a0, a1, a2, a3, p0, p1; if (passivemode) { + u_int32_t tmpaddr; + u_int16_t tmpport; + data = socket(AF_INET, SOCK_STREAM, 0); if (data < 0) { perror("ftp: socket"); @@ -1124,12 +1127,14 @@ initconn(void) memset(&data_addr, 0, sizeof(data_addr)); data_addr.sin_family = AF_INET; - a = (char *)&data_addr.sin_addr.s_addr; + tmpaddr = data_addr.sin_addr.s_addr; + a = (char *)&tmpaddr; a[0] = a0 & 0xff; a[1] = a1 & 0xff; a[2] = a2 & 0xff; a[3] = a3 & 0xff; - p = (char *)&data_addr.sin_port; + tmpport = data_addr.sin_port; + p = (char *)&tmpport; p[0] = p0 & 0xff; p[1] = p1 & 0xff; diff --git a/appl/ftp/ftp/ftp_locl.h b/appl/ftp/ftp/ftp_locl.h index f374f2955..e3906c368 100644 --- a/appl/ftp/ftp/ftp_locl.h +++ b/appl/ftp/ftp/ftp_locl.h @@ -5,6 +5,9 @@ #include #endif +#include +#include + #include #include #include diff --git a/appl/ftp/ftp/main.c b/appl/ftp/ftp/main.c index 34c9eaeda..2da43dd03 100644 --- a/appl/ftp/ftp/main.c +++ b/appl/ftp/ftp/main.c @@ -118,11 +118,12 @@ main(int argc, char **argv) xargv[4] = NULL; setpeer(argc+1, xargv); } - top = setjmp(toplevel) == 0; - if (top) { + if (setjmp(toplevel) == 0) { + top = 1; (void) signal(SIGINT, intr); (void) signal(SIGPIPE, lostpeer); - } + } else + top = 0; for (;;) { cmdscanner(top); top = 1;