diff options
author | runge <runge> | 2006-03-05 00:35:33 +0000 |
---|---|---|
committer | runge <runge> | 2006-03-05 00:35:33 +0000 |
commit | a9a9c812f7feb5bfb1d017575762c6a6390227b9 (patch) | |
tree | 1f1e013d1c905b0e705ec245aa9fec1df6cb1c30 /x11vnc/sslcmds.c | |
parent | b03a920cb996bf61af2d9351d2fe497ea3c0c99e (diff) | |
download | libtdevnc-a9a9c812f7feb5bfb1d017575762c6a6390227b9.tar.gz libtdevnc-a9a9c812f7feb5bfb1d017575762c6a6390227b9.zip |
x11vnc: -unixpw on *bsd, hpux and tru64. -unixpw_nis mode. stunnel and gui tweaks.
Diffstat (limited to 'x11vnc/sslcmds.c')
-rw-r--r-- | x11vnc/sslcmds.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/x11vnc/sslcmds.c b/x11vnc/sslcmds.c index c1dfa92..48340de 100644 --- a/x11vnc/sslcmds.c +++ b/x11vnc/sslcmds.c @@ -19,6 +19,27 @@ void setup_stunnel(int rport, int *argc, char **argv); static pid_t stunnel_pid = 0; +void check_stunnel(void) { + static time_t last_check = 0; + time_t now = time(0); + + if (last_check + 3 >= now) { + return; + } + last_check = now; + + if (stunnel_pid > 0) { + int status; + waitpid(stunnel_pid, &status, WNOHANG); + if (kill(stunnel_pid, 0) != 0) { + waitpid(stunnel_pid, &status, WNOHANG); + rfbLog("stunnel subprocess %d died.\n", stunnel_pid); + stunnel_pid = 0; + clean_up_exit(1); + } + } +} + int start_stunnel(int stunnel_port, int x11vnc_port) { #ifdef SSLCMDS char extra[] = ":/usr/sbin:/usr/local/sbin"; |