diff options
Diffstat (limited to 'net/vtun/files/patch-main.c')
-rw-r--r-- | net/vtun/files/patch-main.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/net/vtun/files/patch-main.c b/net/vtun/files/patch-main.c index 6ec91f8e61ac..5ab2ffb176e0 100644 --- a/net/vtun/files/patch-main.c +++ b/net/vtun/files/patch-main.c @@ -1,39 +1,51 @@ ---- main.c.orig 2008-01-08 07:35:53.000000000 +0900 -+++ main.c 2011-04-21 23:54:45.376770964 +0900 -@@ -50,9 +50,11 @@ +--- main.c.orig 2012-07-07 22:32:57.000000000 -0700 ++++ main.c 2012-09-26 13:37:53.331700962 -0700 +@@ -50,12 +50,14 @@ extern int optind,opterr,optopt; extern char *optarg; +static char* pidfile = VTUN_PID_FILE; + + /* for the NATHack bit. Is our UDP session connected? */ + int is_rmt_fd_connected=1; + int main(int argc, char *argv[], char *env[]) { -- int svr, daemon, sock, dofork, fd, opt; +- int svr, daemon, sock, dofork, fd, opt; + int svr, daemon, sock, dofork, fd, opt, has_pid = 0; struct vtun_host *host = NULL; struct sigaction sa; char *hst; -@@ -89,7 +91,7 @@ +@@ -92,7 +94,7 @@ /* Start logging to syslog and stderr */ openlog("vtund", LOG_PID | LOG_NDELAY | LOG_PERROR, LOG_DAEMON); -- while( (opt=getopt(argc,argv,"misf:P:L:t:np")) != EOF ){ +- while( (opt=getopt(argc,argv,"misf:P:L:t:npq")) != EOF ){ + while( (opt=getopt(argc,argv,"misf:P:L:t:npz:")) != EOF ){ switch(opt){ case 'm': if (mlockall(MCL_CURRENT | MCL_FUTURE) < 0) { -@@ -120,6 +122,10 @@ - case 't': - vtun.timeout = atoi(optarg); - break; +@@ -126,6 +128,10 @@ + case 'q': + vtun.quiet = 1; + break; + case 'z': -+ pidfile = strdup(optarg); ++ pidfile = strdup(optarg); + has_pid = 1; -+ break; ++ break; default: usage(); exit(1); -@@ -198,6 +204,10 @@ +@@ -200,12 +206,19 @@ + + init_title(argc,argv,env,"vtund[s]: "); + ++ if ( has_pid ) ++ write_pid(); ++ + if( vtun.svr_type == VTUN_STAND_ALONE ) + write_pid(); + server(sock); } else { init_title(argc,argv,env,"vtund[c]: "); @@ -44,7 +56,7 @@ client(host); } -@@ -214,7 +224,7 @@ +@@ -222,7 +235,7 @@ { FILE *f; @@ -53,7 +65,7 @@ vtun_syslog(LOG_ERR,"Can't write PID file"); return; } -@@ -236,9 +246,9 @@ +@@ -244,9 +257,9 @@ printf("VTun ver %s\n", VTUN_VER); printf("Usage: \n"); printf(" Server:\n"); |