changeset 200:2847b6cbd915

fc-tmsh rvinterf invokation mode: support passing -B as well
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 19 Dec 2013 08:15:47 +0000
parents 96f56e875862
children 84611183c8c3
files rvinterf/etm/launchrvif.c rvinterf/etm/main.c
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/etm/launchrvif.c	Thu Dec 19 08:06:06 2013 +0000
+++ b/rvinterf/etm/launchrvif.c	Thu Dec 19 08:15:47 2013 +0000
@@ -13,13 +13,13 @@
 
 extern int sock;
 
-char *rvinterf_lopt, *rvinterf_wopt;
+char *rvinterf_Bopt, *rvinterf_lopt, *rvinterf_wopt;
 
 launch_rvinterf(ttyport)
 	char *ttyport;
 {
 	int sp[2], rc;
-	char *rvif_argv[9], Sarg[16], **ap;
+	char *rvif_argv[11], Sarg[16], **ap;
 
 	rc = socketpair(AF_UNIX, SOCK_STREAM, 0, sp);
 	if (rc < 0) {
@@ -32,6 +32,10 @@
 	*ap++ = "rvinterf";
 	*ap++ = Sarg;
 	*ap++ = "-n";
+	if (rvinterf_Bopt) {
+		*ap++ = "-B";
+		*ap++ = rvinterf_Bopt;
+	}
 	if (rvinterf_lopt) {
 		*ap++ = "-l";
 		*ap++ = rvinterf_lopt;
--- a/rvinterf/etm/main.c	Thu Dec 19 08:06:06 2013 +0000
+++ b/rvinterf/etm/main.c	Thu Dec 19 08:15:47 2013 +0000
@@ -13,17 +13,21 @@
 
 int sock;
 
-extern char *rvinterf_lopt, *rvinterf_wopt;
+extern char *rvinterf_Bopt, *rvinterf_lopt, *rvinterf_wopt;
 
 main(argc, argv)
 	char **argv;
 {
+	extern int optind;
 	extern char *optarg;
 	int c;
 	fd_set fds;
 
-	while ((c = getopt(argc, argv, "dl:s:w:")) != EOF)
+	while ((c = getopt(argc, argv, "B:dl:s:w:")) != EOF)
 		switch (c) {
+		case 'B':
+			rvinterf_Bopt = optarg;
+			continue;
 		case 'd':
 			dflag++;
 			continue;
@@ -44,9 +48,9 @@
 		}
 	switch (argc - optind) {
 	case 0:
-		if (rvinterf_lopt || rvinterf_wopt) {
+		if (rvinterf_Bopt || rvinterf_lopt || rvinterf_wopt) {
 			fprintf(stderr,
-	"%s: -l and -w options are meaningful only when launching rvinterf\n",
+      "%s: -B, -l and -w options are meaningful only when launching rvinterf\n",
 				argv[0]);
 			exit(1);
 		}