comparison rvinterf/tmsh/pktsort.c @ 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 e7502631a0f9
children 27c41e4b21ae
comparison
equal deleted inserted replaced
64:d43d82cbfb85 65:21a79f465d6a
10 #include "pktmux.h" 10 #include "pktmux.h"
11 #include "limits.h" 11 #include "limits.h"
12 #include "localsock.h" 12 #include "localsock.h"
13 #include "localtypes.h" 13 #include "localtypes.h"
14 #include "etm.h" 14 #include "etm.h"
15 #include "exitcodes.h"
15 16
16 extern u_char rvi_msg[]; 17 extern u_char rvi_msg[];
17 extern int rvi_msg_len; 18 extern int rvi_msg_len;
18 19
19 static void 20 static void
32 u32 useid; 33 u32 useid;
33 34
34 if (rvi_msg_len < 7) { 35 if (rvi_msg_len < 7) {
35 tty_cleanup(); 36 tty_cleanup();
36 fprintf(stderr, "Error: rvinterf sent us an invalid RVT msg\n"); 37 fprintf(stderr, "Error: rvinterf sent us an invalid RVT msg\n");
37 exit(1); 38 exit(ERROR_RVINTERF);
38 } 39 }
39 useid = rvi_msg[2] << 24 | rvi_msg[3] << 16 | rvi_msg[4] << 8 40 useid = rvi_msg[2] << 24 | rvi_msg[3] << 16 | rvi_msg[4] << 8
40 | rvi_msg[5]; 41 | rvi_msg[5];
41 switch (useid) { 42 switch (useid) {
42 case 0: 43 case 0:
47 return; 48 return;
48 default: 49 default:
49 tty_cleanup(); 50 tty_cleanup();
50 fprintf(stderr, "unexpected fwd of USEID %08X from rvinterf\n", 51 fprintf(stderr, "unexpected fwd of USEID %08X from rvinterf\n",
51 useid); 52 useid);
52 exit(1); 53 exit(ERROR_RVINTERF);
53 } 54 }
54 } 55 }
55 56
56 void 57 void
57 process_pkt_from_target() 58 process_pkt_from_target()
65 return; 66 return;
66 default: 67 default:
67 tty_cleanup(); 68 tty_cleanup();
68 fprintf(stderr, "unexpected fwd of MUX %02X from rvinterf\n", 69 fprintf(stderr, "unexpected fwd of MUX %02X from rvinterf\n",
69 rvi_msg[1]); 70 rvi_msg[1]);
70 exit(1); 71 exit(ERROR_RVINTERF);
71 } 72 }
72 } 73 }