FreeCalypso > hg > freecalypso-tools
diff rvinterf/etmsync/l1tmops.c @ 277:4469d73bbc60
etmsync l1tmops module: need to return on errors, not exit
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 17 Nov 2017 00:37:52 +0000 |
parents | 3e272b956ef4 |
children | 4694c7686ccd |
line wrap: on
line diff
--- a/rvinterf/etmsync/l1tmops.c Fri Nov 17 00:26:09 2017 +0000 +++ b/rvinterf/etmsync/l1tmops.c Fri Nov 17 00:37:52 2017 +0000 @@ -27,11 +27,11 @@ if (rvi_msg[3]) { fprintf(stderr, "target error %u in response to tms\n", rvi_msg[3]); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg_len != 5) { fprintf(stderr, "target error: tms response wrong length\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } return(0); } @@ -48,15 +48,15 @@ if (rvi_msg[3]) { fprintf(stderr, "target error %u in response to rfpr\n", rvi_msg[3]); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg_len != 8) { fprintf(stderr, "target error: rfpr response wrong length\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg[4] != index) { fprintf(stderr, "target error: rfpr response wrong index\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } *retp = rvi_msg[5] | (rvi_msg[6] << 8); return(0); @@ -75,15 +75,15 @@ if (rvi_msg[3]) { fprintf(stderr, "target error %u in response to rfpw\n", rvi_msg[3]); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg_len != 6) { fprintf(stderr, "target error: rfpw response wrong length\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg[4] != index) { fprintf(stderr, "target error: rfpw response wrong index\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } return(0); } @@ -99,15 +99,15 @@ if (rvi_msg[3]) { fprintf(stderr, "target error %u in response to rftr\n", rvi_msg[3]); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg_len < size + 6) { fprintf(stderr, "target error: rftr response too short\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg[4] != index) { fprintf(stderr, "target error: rftr response wrong index\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } bcopy(rvi_msg + 5, table, size); return(0); @@ -124,15 +124,15 @@ if (rvi_msg[3]) { fprintf(stderr, "target error %u in response to ttr\n", rvi_msg[3]); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg_len != 38) { fprintf(stderr, "target error: ttr response wrong length\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } if (rvi_msg[4] != index) { fprintf(stderr, "target error: ttr response wrong index\n"); - exit(ERROR_TARGET); + return(ERROR_TARGET); } bcopy(rvi_msg + 5, buf, 32); return(0);