FreeCalypso > hg > freecalypso-tools
comparison rvinterf/asyncshell/sendsp.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 |
comparison
equal
deleted
inserted
replaced
63:09b4fd9b3827 | 64:d43d82cbfb85 |
---|---|
8 #include <string.h> | 8 #include <string.h> |
9 #include <strings.h> | 9 #include <strings.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include "pktmux.h" | 11 #include "pktmux.h" |
12 #include "limits.h" | 12 #include "limits.h" |
13 #include "exitcodes.h" | |
13 | 14 |
14 send_gpf_sysprim(stackdest, primstr) | 15 send_gpf_sysprim(stackdest, primstr) |
15 char *stackdest, *primstr; | 16 char *stackdest, *primstr; |
16 { | 17 { |
17 unsigned intlen; | 18 unsigned intlen; |
19 unsigned pktlen; | 20 unsigned pktlen; |
20 | 21 |
21 if (strlen(stackdest) > 4) { | 22 if (strlen(stackdest) > 4) { |
22 printf( | 23 printf( |
23 "error: stack destination arg may not exceed 4 characters\n"); | 24 "error: stack destination arg may not exceed 4 characters\n"); |
24 return(1); | 25 return(ERROR_USAGE); |
25 } | 26 } |
26 intlen = 12 + strlen(primstr); | 27 intlen = 12 + strlen(primstr); |
27 pktlen = intlen + 4; | 28 pktlen = intlen + 4; |
28 if (pktlen > MAX_PKT_TO_TARGET) { | 29 if (pktlen > MAX_PKT_TO_TARGET) { |
29 printf("error: max pkt to target limit exceeded\n"); | 30 printf("error: max pkt to target limit exceeded\n"); |
30 return(1); | 31 return(ERROR_USAGE); |
31 } | 32 } |
32 /* fill out the packet */ | 33 /* fill out the packet */ |
33 sendpkt[0] = RVT_L23_HEADER; | 34 sendpkt[0] = RVT_L23_HEADER; |
34 sendpkt[1] = 0xB7; /* system prim */ | 35 sendpkt[1] = 0xB7; /* system prim */ |
35 sendpkt[2] = intlen; | 36 sendpkt[2] = intlen; |