# HG changeset patch # User Mychaela Falconia # Date 1477519239 0 # Node ID 09b4fd9b3827477cc74449f9de248752a1a081cc # Parent 2dd9dbe3f4a7c350bd716ccc5456b282e1dffedc rvinterf/libasync: use the newly adopted exit code convention diff -r 2dd9dbe3f4a7 -r 09b4fd9b3827 rvinterf/libasync/init.c --- a/rvinterf/libasync/init.c Wed Oct 26 21:36:07 2016 +0000 +++ b/rvinterf/libasync/init.c Wed Oct 26 22:00:39 2016 +0000 @@ -1,5 +1,5 @@ /* - * This module contains the common initialization code for fc-tmsh and g23sh. + * This module contains the common initialization code for fc-shell and fc-tmsh. */ #include @@ -12,6 +12,7 @@ #include #include "pktmux.h" #include "localsock.h" +#include "exitcodes.h" extern char *socket_pathname; extern int sock; @@ -26,7 +27,7 @@ sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { perror("socket(AF_UNIX, SOCK_STREAM, 0)"); - exit(1); + exit(ERROR_UNIX); } local.sun_family = AF_UNIX; @@ -48,7 +49,7 @@ rc = connect(sock, (struct sockaddr *) &local, namelen); if (rc != 0) { perror(socket_pathname); - exit(1); + exit(ERROR_RVINTERF); } return(0); diff -r 2dd9dbe3f4a7 -r 09b4fd9b3827 rvinterf/libasync/interf.c --- a/rvinterf/libasync/interf.c Wed Oct 26 21:36:07 2016 +0000 +++ b/rvinterf/libasync/interf.c Wed Oct 26 22:00:39 2016 +0000 @@ -7,6 +7,7 @@ #include #include #include "localsock.h" +#include "exitcodes.h" extern int sock; @@ -47,14 +48,14 @@ tty_cleanup(); fprintf(stderr, "Error from rvinterf: %.*s\n", rvi_msg_len - 1, rvi_msg + 1); - exit(1); + exit(ERROR_RVINTERF); default: bad: tty_cleanup(); fprintf(stderr, "Error: unexpected message type %02X from rvinterf\n", rvi_msg[0]); - exit(1); + exit(ERROR_RVINTERF); } } @@ -67,7 +68,7 @@ if (cc <= 0) { tty_cleanup(); perror("read from rvinterf socket"); - exit(1); + exit(ERROR_RVINTERF); } rx_ptr += cc; rx_left -= cc; @@ -84,7 +85,7 @@ fprintf(stderr, "Invalid length from rvinterf: %02X%02X\n", rvi_msg[0], rvi_msg[1]); - exit(1); + exit(ERROR_RVINTERF); } prep_for_message_rx(); } diff -r 2dd9dbe3f4a7 -r 09b4fd9b3827 rvinterf/libasync/launchrvif.c --- a/rvinterf/libasync/launchrvif.c Wed Oct 26 21:36:07 2016 +0000 +++ b/rvinterf/libasync/launchrvif.c Wed Oct 26 22:00:39 2016 +0000 @@ -1,6 +1,6 @@ /* * This module implements the optional "behind the scenes" invokation - * of rvinterf from fc-tmsh. + * of rvinterf from fc-shell or fc-tmsh. */ #include @@ -8,6 +8,7 @@ #include #include #include +#include "exitcodes.h" static char rvinterf_pathname[] = "/opt/freecalypso/bin/rvinterf"; @@ -24,7 +25,7 @@ rc = socketpair(AF_UNIX, SOCK_STREAM, 0, sp); if (rc < 0) { perror("socketpair"); - exit(1); + exit(ERROR_UNIX); } sock = sp[0]; sprintf(Sarg, "-S%d", sp[1]); @@ -49,7 +50,7 @@ rc = vfork(); if (rc < 0) { perror("vfork for launching rvinterf"); - exit(1); + exit(ERROR_UNIX); } if (!rc) { /* we are in the child - do the exec */ diff -r 2dd9dbe3f4a7 -r 09b4fd9b3827 rvinterf/libasync/ttymagic.c --- a/rvinterf/libasync/ttymagic.c Wed Oct 26 21:36:07 2016 +0000 +++ b/rvinterf/libasync/ttymagic.c Wed Oct 26 22:00:39 2016 +0000 @@ -1,5 +1,5 @@ /* - * This module contains the tty "magic" code for fc-tmsh. + * This module contains the tty "magic" code for fc-shell and fc-tmsh. */ #include