Fix some bugs and typos.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1547 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -768,7 +768,8 @@ remglob(char **argv, int doswitch)
|
||||
}
|
||||
}
|
||||
if (fgets(buf, sizeof (buf), ftemp) == NULL) {
|
||||
fclose(ftemp), ftemp = NULL;
|
||||
fclose(ftemp);
|
||||
ftemp = NULL;
|
||||
return (NULL);
|
||||
}
|
||||
if ((cp = strchr(buf, '\n')) != NULL)
|
||||
@@ -1211,7 +1212,7 @@ shell(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
if (pid > 0)
|
||||
while (wait(&status) != pid)
|
||||
while (waitpid(-1, 0, &status) != pid)
|
||||
;
|
||||
signal(SIGINT, old1);
|
||||
signal(SIGQUIT, old2);
|
||||
@@ -1930,13 +1931,13 @@ void
|
||||
restart(int argc, char **argv)
|
||||
{
|
||||
|
||||
if (argc != 2)
|
||||
printf("restart: offset not specified\n");
|
||||
else {
|
||||
off_t restart_point = atol(argv[1]);
|
||||
printf("restarting at %ld. %s\n", (long)restart_point,
|
||||
"execute get, put or append to initiate transfer");
|
||||
}
|
||||
if (argc != 2)
|
||||
printf("restart: offset not specified\n");
|
||||
else {
|
||||
restart_point = atol(argv[1]);
|
||||
printf("restarting at %ld. %s\n", (long)restart_point,
|
||||
"execute get, put or append to initiate transfer");
|
||||
}
|
||||
}
|
||||
|
||||
/* show remote system type */
|
||||
|
2423
appl/ftp/ftp/ftp.c
2423
appl/ftp/ftp/ftp.c
File diff suppressed because it is too large
Load Diff
@@ -108,28 +108,27 @@ main(int argc, char **argv)
|
||||
strcpy(home, pw->pw_dir);
|
||||
}
|
||||
if (argc > 0) {
|
||||
char *xargv[5];
|
||||
|
||||
if (setjmp(toplevel))
|
||||
exit(0);
|
||||
signal(SIGINT, intr);
|
||||
signal(SIGPIPE, lostpeer);
|
||||
xargv[0] = argv[0]; /* or should this be "ftp"? */
|
||||
xargv[1] = argv[0];
|
||||
xargv[2] = argv[1];
|
||||
xargv[3] = argv[2];
|
||||
xargv[4] = NULL;
|
||||
setpeer(argc+1, xargv);
|
||||
char *xargv[5];
|
||||
|
||||
if (setjmp(toplevel))
|
||||
exit(0);
|
||||
signal(SIGINT, intr);
|
||||
signal(SIGPIPE, lostpeer);
|
||||
xargv[0] = (char*)__progname;
|
||||
xargv[1] = argv[0];
|
||||
xargv[2] = argv[1];
|
||||
xargv[3] = argv[2];
|
||||
xargv[4] = NULL;
|
||||
setpeer(argc+1, xargv);
|
||||
}
|
||||
top = setjmp(toplevel) == 0;
|
||||
if (top) {
|
||||
signal(SIGINT, intr);
|
||||
signal(SIGPIPE, lostpeer);
|
||||
}
|
||||
if (setjmp(toplevel) == 0) {
|
||||
top = 1;
|
||||
signal(SIGINT, intr);
|
||||
signal(SIGPIPE, lostpeer);
|
||||
} else
|
||||
top = 0;
|
||||
for (;;) {
|
||||
cmdscanner(top);
|
||||
top = 1;
|
||||
cmdscanner(top);
|
||||
top = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,35 +139,39 @@ intr(int sig)
|
||||
longjmp(toplevel, 1);
|
||||
}
|
||||
|
||||
#ifndef SHUT_RDWR
|
||||
#define SHUT_RDWR 2
|
||||
#endif
|
||||
|
||||
RETSIGTYPE
|
||||
lostpeer(int sig)
|
||||
{
|
||||
|
||||
if (connected) {
|
||||
if (cout != NULL) {
|
||||
shutdown(fileno(cout), 1+1);
|
||||
fclose(cout);
|
||||
cout = NULL;
|
||||
}
|
||||
if (data >= 0) {
|
||||
shutdown(data, 1+1);
|
||||
close(data);
|
||||
data = -1;
|
||||
}
|
||||
connected = 0;
|
||||
if (connected) {
|
||||
if (cout != NULL) {
|
||||
shutdown(fileno(cout), SHUT_RDWR);
|
||||
fclose(cout);
|
||||
cout = NULL;
|
||||
}
|
||||
pswitch(1);
|
||||
if (connected) {
|
||||
if (cout != NULL) {
|
||||
shutdown(fileno(cout), 1+1);
|
||||
fclose(cout);
|
||||
cout = NULL;
|
||||
}
|
||||
connected = 0;
|
||||
if (data >= 0) {
|
||||
shutdown(data, SHUT_RDWR);
|
||||
close(data);
|
||||
data = -1;
|
||||
}
|
||||
proxflag = 0;
|
||||
pswitch(0);
|
||||
SIGRETURN(0);
|
||||
connected = 0;
|
||||
}
|
||||
pswitch(1);
|
||||
if (connected) {
|
||||
if (cout != NULL) {
|
||||
shutdown(fileno(cout), SHUT_RDWR);
|
||||
fclose(cout);
|
||||
cout = NULL;
|
||||
}
|
||||
connected = 0;
|
||||
}
|
||||
proxflag = 0;
|
||||
pswitch(0);
|
||||
SIGRETURN(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user