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) {
|
if (fgets(buf, sizeof (buf), ftemp) == NULL) {
|
||||||
fclose(ftemp), ftemp = NULL;
|
fclose(ftemp);
|
||||||
|
ftemp = NULL;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
if ((cp = strchr(buf, '\n')) != NULL)
|
if ((cp = strchr(buf, '\n')) != NULL)
|
||||||
@@ -1211,7 +1212,7 @@ shell(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
while (wait(&status) != pid)
|
while (waitpid(-1, 0, &status) != pid)
|
||||||
;
|
;
|
||||||
signal(SIGINT, old1);
|
signal(SIGINT, old1);
|
||||||
signal(SIGQUIT, old2);
|
signal(SIGQUIT, old2);
|
||||||
@@ -1930,13 +1931,13 @@ void
|
|||||||
restart(int argc, char **argv)
|
restart(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
printf("restart: offset not specified\n");
|
printf("restart: offset not specified\n");
|
||||||
else {
|
else {
|
||||||
off_t restart_point = atol(argv[1]);
|
restart_point = atol(argv[1]);
|
||||||
printf("restarting at %ld. %s\n", (long)restart_point,
|
printf("restarting at %ld. %s\n", (long)restart_point,
|
||||||
"execute get, put or append to initiate transfer");
|
"execute get, put or append to initiate transfer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* show remote system type */
|
/* 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);
|
strcpy(home, pw->pw_dir);
|
||||||
}
|
}
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
char *xargv[5];
|
char *xargv[5];
|
||||||
|
|
||||||
if (setjmp(toplevel))
|
if (setjmp(toplevel))
|
||||||
exit(0);
|
exit(0);
|
||||||
signal(SIGINT, intr);
|
signal(SIGINT, intr);
|
||||||
signal(SIGPIPE, lostpeer);
|
signal(SIGPIPE, lostpeer);
|
||||||
xargv[0] = argv[0]; /* or should this be "ftp"? */
|
xargv[0] = (char*)__progname;
|
||||||
xargv[1] = argv[0];
|
xargv[1] = argv[0];
|
||||||
xargv[2] = argv[1];
|
xargv[2] = argv[1];
|
||||||
xargv[3] = argv[2];
|
xargv[3] = argv[2];
|
||||||
xargv[4] = NULL;
|
xargv[4] = NULL;
|
||||||
setpeer(argc+1, xargv);
|
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 (;;) {
|
for (;;) {
|
||||||
cmdscanner(top);
|
cmdscanner(top);
|
||||||
top = 1;
|
top = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,35 +139,39 @@ intr(int sig)
|
|||||||
longjmp(toplevel, 1);
|
longjmp(toplevel, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SHUT_RDWR
|
||||||
|
#define SHUT_RDWR 2
|
||||||
|
#endif
|
||||||
|
|
||||||
RETSIGTYPE
|
RETSIGTYPE
|
||||||
lostpeer(int sig)
|
lostpeer(int sig)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (connected) {
|
if (connected) {
|
||||||
if (cout != NULL) {
|
if (cout != NULL) {
|
||||||
shutdown(fileno(cout), 1+1);
|
shutdown(fileno(cout), SHUT_RDWR);
|
||||||
fclose(cout);
|
fclose(cout);
|
||||||
cout = NULL;
|
cout = NULL;
|
||||||
}
|
|
||||||
if (data >= 0) {
|
|
||||||
shutdown(data, 1+1);
|
|
||||||
close(data);
|
|
||||||
data = -1;
|
|
||||||
}
|
|
||||||
connected = 0;
|
|
||||||
}
|
}
|
||||||
pswitch(1);
|
if (data >= 0) {
|
||||||
if (connected) {
|
shutdown(data, SHUT_RDWR);
|
||||||
if (cout != NULL) {
|
close(data);
|
||||||
shutdown(fileno(cout), 1+1);
|
data = -1;
|
||||||
fclose(cout);
|
|
||||||
cout = NULL;
|
|
||||||
}
|
|
||||||
connected = 0;
|
|
||||||
}
|
}
|
||||||
proxflag = 0;
|
connected = 0;
|
||||||
pswitch(0);
|
}
|
||||||
SIGRETURN(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