# HG changeset patch # User Mychaela Falconia # Date 1477521983 0 # Node ID 21a79f465d6a974b2c4f6ff9743121b8ee9734d4 # Parent d43d82cbfb85aa3b54366433fb154474764286d1 fc-tmsh: use the newly adopted exit code convention diff -r d43d82cbfb85 -r 21a79f465d6a rvinterf/tmsh/main.c --- 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 #include #include +#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(); diff -r d43d82cbfb85 -r 21a79f465d6a rvinterf/tmsh/pktsort.c --- 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); } }