svn rev #3316: branches/krb5-appl-1-0/telnet/telnet/

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Jul 11 15:30:55 EDT 2011


Commit By: ghudson
Log Message:
Pull up r3307 from trunk.

 ------------------------------------------------------------------------
 r3307 | hartmans | 2010-08-05 15:36:05 -0400 (Thu, 05 Aug 2010) | 1 line

 Fix telnet usage exit status



Changed Files:
U   branches/krb5-appl-1-0/telnet/telnet/commands.c
U   branches/krb5-appl-1-0/telnet/telnet/main.c
Modified: branches/krb5-appl-1-0/telnet/telnet/commands.c
===================================================================
--- branches/krb5-appl-1-0/telnet/telnet/commands.c	2011-07-11 19:30:25 UTC (rev 3315)
+++ branches/krb5-appl-1-0/telnet/telnet/commands.c	2011-07-11 19:30:55 UTC (rev 3316)
@@ -2467,8 +2467,7 @@
 	    continue;
 	}
     usage:
-	printf("usage: %s [-l user] [-a] host-name [port]\r\n", cmd);
-	return 0;
+	return 2;
     }
     if (hostp == 0)
 	goto usage;

Modified: branches/krb5-appl-1-0/telnet/telnet/main.c
===================================================================
--- branches/krb5-appl-1-0/telnet/telnet/main.c	2011-07-11 19:30:25 UTC (rev 3315)
+++ branches/krb5-appl-1-0/telnet/telnet/main.c	2011-07-11 19:30:55 UTC (rev 3316)
@@ -322,10 +322,14 @@
 
 		if (setjmp(toplevel) != 0)
 			Exit(0);
-		if (tn(argp - args, args) == 1)
-			return (0);
-		else
-			return (1);
+		{
+			int ret = tn(argp - args, args);
+			switch (ret) {
+				case 1: return 0;
+				case 2: usage();
+				default: return 1;
+			}
+		}
 	}
 	(void)setjmp(toplevel);
 	for (;;) {




More information about the Krb5-appl-commits mailing list