FreeCalypso > hg > freecalypso-sw
comparison 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 |
comparison
equal
deleted
inserted
replaced
190:405f5b46cdc4 | 191:cf8583923dc4 |
---|---|
3 */ | 3 */ |
4 | 4 |
5 #include <sys/types.h> | 5 #include <sys/types.h> |
6 #include <sys/errno.h> | 6 #include <sys/errno.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | |
9 #include <strings.h> | |
8 #include <stdlib.h> | 10 #include <stdlib.h> |
9 #include <unistd.h> | 11 #include <unistd.h> |
10 #include <signal.h> | 12 #include <signal.h> |
11 #include <time.h> | 13 #include <time.h> |
12 #include "../pktmux.h" | 14 #include "../pktmux.h" |
27 int background; | 29 int background; |
28 int max_fd; | 30 int max_fd; |
29 | 31 |
30 char *socket_pathname = "/tmp/rvinterf_socket"; | 32 char *socket_pathname = "/tmp/rvinterf_socket"; |
31 | 33 |
34 int wakeup_after_sec; | |
35 | |
32 main(argc, argv) | 36 main(argc, argv) |
33 char **argv; | 37 char **argv; |
34 { | 38 { |
35 extern char *optarg; | 39 extern char *optarg; |
36 extern int optind; | 40 extern int optind; |
37 int c; | 41 int c; |
38 fd_set fds; | 42 fd_set fds; |
39 struct client *cli, **clip; | 43 struct client *cli, **clip; |
40 | 44 |
41 while ((c = getopt(argc, argv, "bB:d:l:s:")) != EOF) | 45 while ((c = getopt(argc, argv, "bB:d:l:s:w:")) != EOF) |
42 switch (c) { | 46 switch (c) { |
43 case 'b': | 47 case 'b': |
44 background++; | 48 background++; |
45 continue; | 49 continue; |
46 case 'B': | 50 case 'B': |
52 case 'l': | 56 case 'l': |
53 logfname = optarg; | 57 logfname = optarg; |
54 continue; | 58 continue; |
55 case 's': | 59 case 's': |
56 socket_pathname = optarg; | 60 socket_pathname = optarg; |
61 continue; | |
62 case 'w': | |
63 wakeup_after_sec = strtoul(optarg, 0, 0); | |
57 continue; | 64 continue; |
58 case '?': | 65 case '?': |
59 default: | 66 default: |
60 usage: fprintf(stderr, | 67 usage: fprintf(stderr, |
61 "usage: %s [options] ttyport\n", argv[0]); | 68 "usage: %s [options] ttyport\n", argv[0]); |