fixed warning and minor portability fix

svn path=/trunk/; revision=14654
This commit is contained in:
Thomas Bluemel 2005-04-17 19:32:24 +00:00
parent ddc52fc76c
commit 3e18dad277
2 changed files with 11 additions and 10 deletions

View file

@ -235,7 +235,7 @@ char *getpass (const char * prompt)
static char input[256]; static char input[256];
HANDLE in; HANDLE in;
HANDLE err; HANDLE err;
int count; DWORD count;
in = GetStdHandle (STD_INPUT_HANDLE); in = GetStdHandle (STD_INPUT_HANDLE);
err = GetStdHandle (STD_ERROR_HANDLE); err = GetStdHandle (STD_ERROR_HANDLE);

View file

@ -97,7 +97,7 @@ uid_t getuid();
sig_t lostpeer(); sig_t lostpeer();
off_t restart_point = 0; off_t restart_point = 0;
int cin, cout; SOCKET cin, cout;
int dataconn(char *mode); int dataconn(char *mode);
int command(char *fmt, ...); int command(char *fmt, ...);
@ -113,7 +113,8 @@ void psabort(int sig);
char *hookup(char *host, int port) char *hookup(char *host, int port)
{ {
register struct hostent *hp = 0; register struct hostent *hp = 0;
int s,len; int len;
SOCKET s;
static char hostnamebuf[80]; static char hostnamebuf[80];
bzero((char *)&hisctladdr, sizeof (hisctladdr)); bzero((char *)&hisctladdr, sizeof (hisctladdr));
@ -136,7 +137,7 @@ char *hookup(char *host, int port)
} }
hostname = hostnamebuf; hostname = hostnamebuf;
s = socket(hisctladdr.sin_family, SOCK_STREAM, 0); s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);
if (s < 0) { if (s == INVALID_SOCKET) {
perror("ftp: socket"); perror("ftp: socket");
code = -1; code = -1;
return (0); return (0);
@ -1327,8 +1328,8 @@ void pswitch(int flag)
char name[MAXHOSTNAMELEN]; char name[MAXHOSTNAMELEN];
struct sockaddr_in mctl; struct sockaddr_in mctl;
struct sockaddr_in hctl; struct sockaddr_in hctl;
FILE *in; SOCKET in;
FILE *out; SOCKET out;
int tpe; int tpe;
int cpnd; int cpnd;
int sunqe; int sunqe;
@ -1371,10 +1372,10 @@ void pswitch(int flag)
hisctladdr = op->hctl; hisctladdr = op->hctl;
ip->mctl = myctladdr; ip->mctl = myctladdr;
myctladdr = op->mctl; myctladdr = op->mctl;
(int) ip->in = cin; // What the hell am I looking at...? ip->in = cin;
cin = (int) op->in; cin = op->in;
(int) ip->out = cout; // Same again... ip->out = cout;
cout = (int) op->out; cout = op->out;
ip->tpe = type; ip->tpe = type;
type = op->tpe; type = op->tpe;
if (!type) if (!type)