diff options
author | brian <brian@cvs.openbsd.org> | 1997-12-15 23:36:35 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1997-12-15 23:36:35 +0000 |
commit | 1780a00664bea6cd3e4b4a252d8e0e3f765655c9 (patch) | |
tree | c9481001811d933733514df5694ecb3d0048a888 /usr.sbin/ppp/alias_cmd.c | |
parent | bfddc6a53b43b088d051d6bff1daa65662e7f86e (diff) |
Correct return values from alias routines.
(Only available if -DHAVE_LIBALIAS is specified)
Diffstat (limited to 'usr.sbin/ppp/alias_cmd.c')
-rw-r--r-- | usr.sbin/ppp/alias_cmd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/ppp/alias_cmd.c b/usr.sbin/ppp/alias_cmd.c index 240772833e2..886a0a251dd 100644 --- a/usr.sbin/ppp/alias_cmd.c +++ b/usr.sbin/ppp/alias_cmd.c @@ -1,5 +1,5 @@ /* - * $Id: alias_cmd.c,v 1.1 1997/11/23 20:27:32 brian Exp $ + * $Id: alias_cmd.c,v 1.2 1997/12/15 23:36:34 brian Exp $ */ #include <sys/param.h> @@ -33,6 +33,7 @@ AliasRedirectPort(struct cmdargs const *arg) if (!(mode & MODE_ALIAS)) { if (VarTerm) fprintf(VarTerm, "Alias not enabled\n"); + return 1; } else if (arg->argc == 3) { char proto_constant; const char *proto; @@ -83,10 +84,10 @@ AliasRedirectPort(struct cmdargs const *arg) if (link == NULL && VarTerm) fprintf(VarTerm, "port redirect: error returned by packed" " aliasing engine (code=%d)\n", error); - } else if (VarTerm) - fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); + } else + return -1; - return 1; + return 0; } @@ -96,6 +97,7 @@ AliasRedirectAddr(struct cmdargs const *arg) if (!(mode & MODE_ALIAS)) { if (VarTerm) fprintf(VarTerm, "alias not enabled\n"); + return 1; } else if (arg->argc == 2) { int error; struct in_addr local_addr; @@ -121,10 +123,10 @@ AliasRedirectAddr(struct cmdargs const *arg) fprintf(VarTerm, "address redirect: packet aliasing engine error\n"); fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); } - } else if (VarTerm) - fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); + } else + return -1; - return 1; + return 0; } |