printf("\n");
(void) fflush(stdout);
}
- if (cout == (int) NULL) {
+ if (cout == 0) {
perror ("No control connection for command");
code = -1;
return (0);
cp = reply_string;
while ((c = fgetcSocket(cin)) != '\n') {
if (c == IAC) { /* handle telnet commands */
- switch (c = fgetcSocket(cin)) {
+ switch (fgetcSocket(cin)) {
case WILL:
case WONT:
c = fgetcSocket(cin);
{
FILE *fin;
int dout = 0;
- int (*closefunc)(), _pclose(), fclose();
+ int (*closefunc)();
sig_t (*oldintr)(), (*oldintp)();
char buf[BUFSIZ], *bufp;
long bytes = 0, hashbytes = HASHBYTES;
return;
}
dout = dataconn(mode);
- if (dout == (int)NULL)
+ if (!dout)
goto abort;
(void) gettimeofday(&start, (struct timezone *)0);
null();// oldintp = signal(SIGPIPE, SIG_IGN);
{
FILE *fout = stdout;
int din = 0;
- int (*closefunc)(), _pclose(), fclose();
+ int (*closefunc)();
void (*oldintr)(int), (*oldintp)(int);
int oldverbose = 0, oldtype = 0, is_retr, tcrflag, nfnd, bare_lfs = 0;
char msg;
long bytes = 0, hashbytes = HASHBYTES;
// struct
fd_set mask;
- register int c, d;
+ register int c;
struct timeval start, stop;
// struct stat st;
- extern void *malloc();
is_retr = strcmp(cmd, "RETR") == 0;
if (is_retr && verbose && printnames) {
null();// oldintr = signal(SIGINT, abortrecv);
if (strcmp(local, "-") && *local != '|') {
#ifndef _WIN32
+ register int d;
// This whole thing is a problem... access Won't work on non-existent files
if (access(local, 2) < 0) {
char *dir = rindex(local, '/');
}
}
din = dataconn("r");
- if (din == (int)NULL)
+ if (!din)
goto abort;
if (strcmp(local, "-") == 0)
fout = stdout;
(*closefunc)(fout);
return;
}
- errno = d = 0;
+ errno = 0;
// while ((c = recv(din, buf, bufsize, 1)) > 0) {
// if ((d = write(fileno(fout), buf, c)) != c)
// if ((d = write(fileno(fout), buf, c)) != c)
lostpeer();
}
if (din && FD_ISSET(din, &mask)) {
- while ((c = recv(din, buf, bufsize, 0)) > 0)
+ while (recv(din, buf, bufsize, 0) > 0)
;
}
- if ((c = getreply(0)) == ERROR && code == 552) { /* needed for nic style abort */
+ if (getreply(0) == ERROR && code == 552) { /* needed for nic style abort */
if (data >= 0) {
(void) close(data);
data = -1;
null();// (void) signal(SIGINT,oldintr);
}
-/*
- * Need to start a listen on the data channel
- * before we send the command, otherwise the
- * server's connect may fail.
- */
-int sendport = -1;
-
int
initconn()
{
if (s < 0) {
perror("ftp: accept");
(void) closesocket(data), data = -1;
- return (int) (NULL);
+ return 0;
}
if(closesocket(data)) {
int iret=WSAGetLastError ();