FreeCalypso > hg > freecalypso-tools
comparison rvinterf/asyncshell/pktsort.c @ 64:d43d82cbfb85
fc-shell: use the newly adopted exit code convention
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 26 Oct 2016 22:25:18 +0000 |
parents | e7502631a0f9 |
children | bbc41034f14c |
comparison
equal
deleted
inserted
replaced
63:09b4fd9b3827 | 64:d43d82cbfb85 |
---|---|
9 #include <stdlib.h> | 9 #include <stdlib.h> |
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 "exitcodes.h" | |
14 | 15 |
15 extern u_char rvi_msg[]; | 16 extern u_char rvi_msg[]; |
16 extern int rvi_msg_len; | 17 extern int rvi_msg_len; |
17 | 18 |
18 static void | 19 static void |
21 u32 useid; | 22 u32 useid; |
22 | 23 |
23 if (rvi_msg_len < 7) { | 24 if (rvi_msg_len < 7) { |
24 tty_cleanup(); | 25 tty_cleanup(); |
25 fprintf(stderr, "Error: rvinterf sent us an invalid RVT msg\n"); | 26 fprintf(stderr, "Error: rvinterf sent us an invalid RVT msg\n"); |
26 exit(1); | 27 exit(ERROR_RVINTERF); |
27 } | 28 } |
28 useid = rvi_msg[2] << 24 | rvi_msg[3] << 16 | rvi_msg[4] << 8 | 29 useid = rvi_msg[2] << 24 | rvi_msg[3] << 16 | rvi_msg[4] << 8 |
29 | rvi_msg[5]; | 30 | rvi_msg[5]; |
30 switch (useid) { | 31 switch (useid) { |
31 case 0: | 32 case 0: |
33 return; | 34 return; |
34 default: | 35 default: |
35 tty_cleanup(); | 36 tty_cleanup(); |
36 fprintf(stderr, "unexpected fwd of USEID %08X from rvinterf\n", | 37 fprintf(stderr, "unexpected fwd of USEID %08X from rvinterf\n", |
37 useid); | 38 useid); |
38 exit(1); | 39 exit(ERROR_RVINTERF); |
39 } | 40 } |
40 } | 41 } |
41 | 42 |
42 static void | 43 static void |
43 gpf_packet_rx() | 44 gpf_packet_rx() |
76 return; | 77 return; |
77 default: | 78 default: |
78 tty_cleanup(); | 79 tty_cleanup(); |
79 fprintf(stderr, "unexpected fwd of MUX %02X from rvinterf\n", | 80 fprintf(stderr, "unexpected fwd of MUX %02X from rvinterf\n", |
80 rvi_msg[1]); | 81 rvi_msg[1]); |
81 exit(1); | 82 exit(ERROR_RVINTERF); |
82 } | 83 } |
83 } | 84 } |