diff options
| author | Itamar Reis Peixoto <itamar@ispbrasil.com.br> | 2016-02-08 22:37:44 -0200 |
|---|---|---|
| committer | Itamar Reis Peixoto <itamar@ispbrasil.com.br> | 2016-02-08 22:37:44 -0200 |
| commit | ee436aeec9385a77cb547384575bcc2f9ad2746c (patch) | |
| tree | d7fc2f98e36a9c06713284e450ad9bf98653346e /xrdpapi | |
| parent | 40a197e7a8960fdaefb1e4bd90344c5734bd9e77 (diff) | |
| parent | 2a5d204baaa84207e835af570d89b10a17083fae (diff) | |
| download | xrdp-proprietary-ee436aeec9385a77cb547384575bcc2f9ad2746c.tar.gz xrdp-proprietary-ee436aeec9385a77cb547384575bcc2f9ad2746c.zip | |
Merge pull request #309 from proski/devel
Fixes for autotools, compile warnings and MacOS compatibility
Diffstat (limited to 'xrdpapi')
| -rw-r--r-- | xrdpapi/Makefile.am | 6 | ||||
| -rw-r--r-- | xrdpapi/xrdpapi.c | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/xrdpapi/Makefile.am b/xrdpapi/Makefile.am index 88ef100e..8107ffeb 100644 --- a/xrdpapi/Makefile.am +++ b/xrdpapi/Makefile.am @@ -5,10 +5,8 @@ EXTRA_INCLUDES = EXTRA_LIBS = EXTRA_FLAGS = -AM_CFLAGS = \ - $(EXTRA_DEFINES) - -INCLUDES = \ +AM_CPPFLAGS = \ + $(EXTRA_DEFINES) \ $(EXTRA_INCLUDES) lib_LTLIBRARIES = \ diff --git a/xrdpapi/xrdpapi.c b/xrdpapi/xrdpapi.c index cd343e75..974a094c 100644 --- a/xrdpapi/xrdpapi.c +++ b/xrdpapi/xrdpapi.c @@ -162,6 +162,14 @@ WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName, return wts; } +/* + * Prevent receiving SIGPIPE on disconnect using either MSG_NOSIGNAL (Linux) + * or SO_NOSIGPIPE (Mac OS X) + */ +#if !defined(MSG_NOSIGNAL) +#define MSG_NOSIGNAL 0 +#endif + /*****************************************************************************/ static int mysend(int sck, const void* adata, int bytes) @@ -170,6 +178,11 @@ mysend(int sck, const void* adata, int bytes) int error; const char* data; +#if defined(SO_NOSIGPIPE) + const int on = 1; + setsockopt(sck, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); +#endif + data = (const char*)adata; sent = 0; while (sent < bytes) |
