diff rvinterf/libasync/interf.c @ 63:09b4fd9b3827

rvinterf/libasync: use the newly adopted exit code convention
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 26 Oct 2016 22:00:39 +0000
parents e7502631a0f9
children
line wrap: on
line diff
--- 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 <stdlib.h>
 #include <unistd.h>
 #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();
 	}