diff rvinterf/lowlevel/rvifmain.c @ 191:cf8583923dc4

rvinterf: workaround for sleeping targets
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 25 Nov 2013 04:41:36 +0000
parents f5f8776f7c66
children 549e6cd1e77d
line wrap: on
line diff
--- a/rvinterf/lowlevel/rvifmain.c	Mon Nov 25 03:23:19 2013 +0000
+++ b/rvinterf/lowlevel/rvifmain.c	Mon Nov 25 04:41:36 2013 +0000
@@ -5,6 +5,8 @@
 #include <sys/types.h>
 #include <sys/errno.h>
 #include <stdio.h>
+#include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <signal.h>
@@ -29,6 +31,8 @@
 
 char *socket_pathname = "/tmp/rvinterf_socket";
 
+int wakeup_after_sec;
+
 main(argc, argv)
 	char **argv;
 {
@@ -38,7 +42,7 @@
 	fd_set fds;
 	struct client *cli, **clip;
 
-	while ((c = getopt(argc, argv, "bB:d:l:s:")) != EOF)
+	while ((c = getopt(argc, argv, "bB:d:l:s:w:")) != EOF)
 		switch (c) {
 		case 'b':
 			background++;
@@ -55,6 +59,9 @@
 		case 's':
 			socket_pathname = optarg;
 			continue;
+		case 'w':
+			wakeup_after_sec = strtoul(optarg, 0, 0);
+			continue;
 		case '?':
 		default:
 usage:			fprintf(stderr,