• Floris Bos's avatar
    tls_openssl.c: enable extra POSIX functionality to get PTHREAD_MUTEX_RECURSIVE · ac63d743
    Floris Bos authored
    On some systems pthread_mutexattr_settype() and PTHREAD_MUTEX_RECURSIVE are
    not available by default.
    Either _XOPEN_SOURCE or _POSIX_C_SOURCE needs to be set to to the right level
    before including any system include file in order to have them exposed.
    
    Fixes the following compile error:
    
    ==
    tls_openssl.c: In function 'dyn_create_function':
    tls_openssl.c:91:2: warning: implicit declaration of function 'pthread_mutexattr_settype' [-Wimplicit-function-declaration]
      MUTEX_INIT(value->mutex);
      ^
    tls_openssl.c:42:40: error: 'PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function)
      pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE);\
                                            ^
    tls_openssl.c:91:2: note: in expansion of macro 'MUTEX_INIT'
      MUTEX_INIT(value->mutex);
      ^
    tls_openssl.c:42:40: note: each undeclared identifier is reported only once for each function it appears in
      pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE);\
                                            ^
    tls_openssl.c:91:2: note: in expansion of macro 'MUTEX_INIT'
      MUTEX_INIT(value->mutex);
      ^
    tls_openssl.c: In function 'InitializeTLS':
    tls_openssl.c:42:40: error: 'PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function)
      pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE);\
                                            ^
    tls_openssl.c:156:5: note: in expansion of macro 'MUTEX_INIT'
         MUTEX_INIT(mutex_buf[i]);
         ^
    tls_openssl.c: In function 'ssl_verify':
    tls_openssl.c:177:7: warning: variable 'err' set but not used [-Wunused-but-set-variable]
       int err, i;
           ^
    tls_openssl.c:176:14: warning: variable 'client' set but not used [-Wunused-but-set-variable]
       rfbClient *client;
                  ^
    make[3]: *** [tls_openssl.lo] Error 1
    ==
    Signed-off-by: 's avatarFloris Bos <bos@je-eigen-domein.nl>
    ac63d743
Name
Last commit
Last update
client_examples Loading commit data...
common Loading commit data...
compat/msvc Loading commit data...
examples Loading commit data...
libvncclient Loading commit data...
libvncserver Loading commit data...
m4 Loading commit data...
rfb Loading commit data...
test Loading commit data...
utils Loading commit data...
webclients Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
Doxyfile Loading commit data...
LibVNCServer.spec.in Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
TODO Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
libvncclient.pc.in Loading commit data...
libvncserver-config.in Loading commit data...
libvncserver.pc.in Loading commit data...