diff options
author | runge <runge> | 2006-12-10 03:12:02 +0000 |
---|---|---|
committer | runge <runge> | 2006-12-10 03:12:02 +0000 |
commit | 5b198763c597459a27e7e88827dcc748b98b6670 (patch) | |
tree | 07111d31dc1932bd6c5bb99bd899916e5efb7129 /x11vnc/cleanup.c | |
parent | 726cedb871a70aa6307df74e769605ee89bd52d0 (diff) | |
download | libtdevnc-5b198763c597459a27e7e88827dcc748b98b6670.tar.gz libtdevnc-5b198763c597459a27e7e88827dcc748b98b6670.zip |
x11vnc: FINDCREATEDISPLAY support to create X session if one cannot be found. Fix bug in java viewer.
Diffstat (limited to 'x11vnc/cleanup.c')
-rw-r--r-- | x11vnc/cleanup.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/x11vnc/cleanup.c b/x11vnc/cleanup.c index 16115cd..199220d 100644 --- a/x11vnc/cleanup.c +++ b/x11vnc/cleanup.c @@ -35,6 +35,7 @@ char *xerror_string(XErrorEvent *error); void initialize_crash_handler(void); void initialize_signals(void); void unset_signals(void); +void close_exec_fds(void); int known_sigpipe_mode(char *s); @@ -542,6 +543,18 @@ void unset_signals(void) { signal(SIGPIPE, SIG_DFL); } +void close_exec_fds(void) { + int fd; +#ifdef FD_CLOEXEC + for (fd = 3; fd < 64; fd++) { + int flags = fcntl(fd, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + fcntl(fd, F_SETFD, flags); + } + } +#endif +} int known_sigpipe_mode(char *s) { /* |