changeset 581:d43dc6dfb44c

-P option added to rvinterf
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Feb 2020 22:23:17 +0000
parents ca28592b0b34
children deda54106c0e
files rvinterf/lowlevel/Makefile rvinterf/lowlevel/rvifmain.c
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/lowlevel/Makefile	Sun Feb 02 22:04:12 2020 +0000
+++ b/rvinterf/lowlevel/Makefile	Sun Feb 02 22:23:17 2020 +0000
@@ -2,6 +2,7 @@
 CFLAGS=	-O2
 PROGS=	rvtdump rvinterf tfc139
 LIBS=	../../libserial/libserial.a ../libg23/libg23.a
+LIBPWON=../../libpwon/libpwon.a
 
 INSTALL_PREFIX=	/opt/freecalypso
 
@@ -20,8 +21,8 @@
 rvtdump:	${RVTDUMP_OBJS} ${LIBS}
 	${CC} ${CFLAGS} -o $@ ${RVTDUMP_OBJS} ${LIBS}
 
-rvinterf:	${RVINTERF_OBJS} ${LIBS}
-	${CC} ${CFLAGS} -o $@ ${RVINTERF_OBJS} ${LIBS}
+rvinterf:	${RVINTERF_OBJS} ${LIBS} ${LIBPWON}
+	${CC} ${CFLAGS} -o $@ ${RVINTERF_OBJS} ${LIBS} ${LIBPWON}
 
 tfc139:		${TFC139_OBJS} ${LIBS}
 	${CC} ${CFLAGS} -o $@ ${TFC139_OBJS} ${LIBS}
--- a/rvinterf/lowlevel/rvifmain.c	Sun Feb 02 22:04:12 2020 +0000
+++ b/rvinterf/lowlevel/rvifmain.c	Sun Feb 02 22:23:17 2020 +0000
@@ -49,7 +49,7 @@
 	fd_set fds;
 	struct client *cli, **clip;
 
-	while ((c = getopt(argc, argv, "bB:d:l:ns:S:w:X:")) != EOF)
+	while ((c = getopt(argc, argv, "bB:d:l:nP:s:S:w:X:")) != EOF)
 		switch (c) {
 		case 'b':
 			background++;
@@ -66,6 +66,10 @@
 		case 'l':
 			logfname = optarg;
 			continue;
+		case 'P':
+			if (find_bootctrl_entry(optarg) < 0)
+				exit(1);	/* error msg already printed */
+			continue;
 		case 's':
 			socket_pathname = optarg;
 			continue;
@@ -121,6 +125,7 @@
 		}
 	}
 	signal(SIGPIPE, SIG_IGN);
+	pwon_if_needed();
 	for (;;) {
 		FD_ZERO(&fds);
 		FD_SET(target_fd, &fds);