1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00

Correct the return of DialModem()

Suggested by:	kfurge <kfurge@worldnet.att.net>
This commit is contained in:
Brian Somers 1997-05-29 02:29:13 +00:00
parent f9220cde63
commit e83481f965
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26256
3 changed files with 12 additions and 15 deletions

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: command.c,v 1.49 1997/05/24 17:32:33 brian Exp $
* $Id: command.c,v 1.50 1997/05/26 00:43:58 brian Exp $
*
*/
#include <sys/types.h>
@ -153,7 +153,7 @@ char **argv;
printf("failed to open modem.\n");
break;
}
if (DialModem()) {
if (DialModem() == EX_DONE) {
sleep(1);
ModemTimeout();
PacketMode();

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.56 1997/05/24 17:32:40 brian Exp $
* $Id: main.c,v 1.57 1997/05/26 00:44:06 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@ -818,7 +818,7 @@ DoLoop()
VarDialTries);
else
LogPrintf(LOG_CHAT_BIT, "Dial attempt %u\n", tries);
if (DialModem()) {
if (DialModem() == EX_DONE) {
sleep(1); /* little pause to allow peer starts */
ModemTimeout();
PacketMode();

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: modem.c,v 1.39 1997/05/24 17:32:41 brian Exp $
* $Id: modem.c,v 1.40 1997/05/26 00:44:06 brian Exp $
*
* TODO:
*/
@ -755,7 +755,7 @@ int
DialModem()
{
char ScriptBuffer[200];
int excode = 0;
int excode;
strncpy(ScriptBuffer, VarDialScript,sizeof(ScriptBuffer)-1);
ScriptBuffer[sizeof(ScriptBuffer)-1] = '\0';
@ -766,20 +766,17 @@ DialModem()
if (DoChat(ScriptBuffer) > 0) {
if ((mode & (MODE_INTER|MODE_AUTO)) == MODE_INTER)
fprintf(stderr, "login OK!\n");
return(1);
} else {
if ((mode & (MODE_INTER|MODE_AUTO)) == MODE_INTER) {
fprintf(stderr, "login failed.\n");
excode = EX_NOLOGIN;
}
return EX_DONE;
}
if ((mode & (MODE_INTER|MODE_AUTO)) == MODE_INTER)
fprintf(stderr, "login failed.\n");
ModemTimeout(); /* Dummy call to check modem status */
excode = EX_NOLOGIN;
}
else {
if ((mode & (MODE_INTER|MODE_AUTO)) == MODE_INTER) {
if ((mode & (MODE_INTER|MODE_AUTO)) == MODE_INTER)
fprintf(stderr, "dial failed.\n");
excode = EX_NODIAL;
}
excode = EX_NODIAL;
}
HangupModem(0);
return(excode);