changeset 65:21a79f465d6a

fc-tmsh: use the newly adopted exit code convention
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 26 Oct 2016 22:46:23 +0000
parents d43d82cbfb85
children ee89ff178ba5
files rvinterf/tmsh/main.c rvinterf/tmsh/pktsort.c
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/main.c	Wed Oct 26 22:25:18 2016 +0000
+++ b/rvinterf/tmsh/main.c	Wed Oct 26 22:46:23 2016 +0000
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include "exitcodes.h"
 
 char *socket_pathname = "/tmp/rvinterf_socket";
 int ttyhacks, dflag;
@@ -44,7 +45,7 @@
 		default:
 usage:			fprintf(stderr,
 				"usage: %s [options] [ttyport]\n", argv[0]);
-			exit(1);
+			exit(ERROR_USAGE);
 		}
 	switch (argc - optind) {
 	case 0:
@@ -52,7 +53,7 @@
 			fprintf(stderr,
       "%s: -B, -l and -w options are meaningful only when launching rvinterf\n",
 				argv[0]);
-			exit(1);
+			exit(ERROR_USAGE);
 		}
 		break;
 	case 1:
@@ -75,7 +76,7 @@
 				continue;
 			tty_cleanup();
 			perror("select");
-			exit(1);
+			exit(ERROR_UNIX);
 		}
 		if (FD_ISSET(0, &fds))
 			handle_tty_input();
--- a/rvinterf/tmsh/pktsort.c	Wed Oct 26 22:25:18 2016 +0000
+++ b/rvinterf/tmsh/pktsort.c	Wed Oct 26 22:46:23 2016 +0000
@@ -12,6 +12,7 @@
 #include "localsock.h"
 #include "localtypes.h"
 #include "etm.h"
+#include "exitcodes.h"
 
 extern u_char rvi_msg[];
 extern int rvi_msg_len;
@@ -34,7 +35,7 @@
 	if (rvi_msg_len < 7) {
 		tty_cleanup();
 		fprintf(stderr, "Error: rvinterf sent us an invalid RVT msg\n");
-		exit(1);
+		exit(ERROR_RVINTERF);
 	}
 	useid = rvi_msg[2] << 24 | rvi_msg[3] << 16 | rvi_msg[4] << 8
 		| rvi_msg[5];
@@ -49,7 +50,7 @@
 		tty_cleanup();
 		fprintf(stderr, "unexpected fwd of USEID %08X from rvinterf\n",
 			useid);
-		exit(1);
+		exit(ERROR_RVINTERF);
 	}
 }
 
@@ -67,6 +68,6 @@
 		tty_cleanup();
 		fprintf(stderr, "unexpected fwd of MUX %02X from rvinterf\n",
 			rvi_msg[1]);
-		exit(1);
+		exit(ERROR_RVINTERF);
 	}
 }