Commit 4f676455 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor fix when socket based tip fails, and we revert to tty based;

Need to reset the getremote state so that we can do a second search
in /etc/remote file.
parent 76b40069
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id: cmdtab.c,v 1.2 2000-12-27 00:49:33 mike Exp $"; "$Id: cmdtab.c,v 1.3 2001-08-16 16:33:27 stoller Exp $";
#endif /* not lint */ #endif /* not lint */
#include "tip.h" #include "tip.h"
...@@ -49,6 +49,7 @@ esctable_t etable[] = { ...@@ -49,6 +49,7 @@ esctable_t etable[] = {
{ '!', NORM, "shell", shell }, { '!', NORM, "shell", shell },
{ 'c', NORM, "change directory", chdirectory }, { 'c', NORM, "change directory", chdirectory },
{ '.', NORM, "exit from tip", finish }, { '.', NORM, "exit from tip", finish },
{ ',', NORM, "exit from tip", finish },
{CTRL('d'),NORM,"exit from tip", finish }, {CTRL('d'),NORM,"exit from tip", finish },
{CTRL('y'),NORM,"suspend tip (local+remote)", suspend }, {CTRL('y'),NORM,"suspend tip (local+remote)", suspend },
{CTRL('z'),NORM,"suspend tip (local only)", suspend }, {CTRL('z'),NORM,"suspend tip (local only)", suspend },
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id: hunt.c,v 1.6 2001-08-14 19:05:12 stoller Exp $"; "$Id: hunt.c,v 1.7 2001-08-16 16:33:27 stoller Exp $";
#endif /* not lint */ #endif /* not lint */
#ifdef USESOCKETS #ifdef USESOCKETS
...@@ -172,9 +172,10 @@ socket_hunt(name) ...@@ -172,9 +172,10 @@ socket_hunt(name)
} }
alarm(0); alarm(0);
if (FD < 0) { if (FD < 0) {
warn("%s", name);
deadfl = 1; deadfl = 1;
} }
if (deadfl)
getremote_reset();
signal(SIGALRM, f); signal(SIGALRM, f);
return (deadfl ? -1 : 0); return (deadfl ? -1 : 0);
} }
......
...@@ -43,7 +43,7 @@ static const char copyright[] = ...@@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id: remote.c,v 1.2 2000-12-27 00:49:35 mike Exp $"; "$Id: remote.c,v 1.3 2001-08-16 16:33:27 stoller Exp $";
#endif /* not lint */ #endif /* not lint */
#include "tip.h" #include "tip.h"
...@@ -258,13 +258,14 @@ getremcap(host) ...@@ -258,13 +258,14 @@ getremcap(host)
ET = 10; ET = 10;
} }
static int lookedup = 0;
char * char *
getremote(host) getremote(host)
char *host; char *host;
{ {
register char *cp; register char *cp;
static char *next; static char *next;
static int lookedup = 0;
if (!lookedup) { if (!lookedup) {
if (host == NOSTR && (host = getenv("HOST")) == NOSTR) if (host == NOSTR && (host = getenv("HOST")) == NOSTR)
...@@ -289,3 +290,12 @@ getremote(host) ...@@ -289,3 +290,12 @@ getremote(host)
} }
return (DV); return (DV);
} }
void
getremote_reset()
{
lookedup = 0;
DV = 0;
BR = 0;
HW = 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment