projects
/
free-sw
/
xcb
/
libxcb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xcb_disconnect: call shutdown() to force a disconnect
[free-sw/xcb/libxcb]
/
src
/
xcb_conn.c
diff --git
a/src/xcb_conn.c
b/src/xcb_conn.c
index
7e18891
..
803f7aa
100644
(file)
--- a/
src/xcb_conn.c
+++ b/
src/xcb_conn.c
@@
-42,6
+42,11
@@
#include <sys/select.h>
#endif
#include <sys/select.h>
#endif
+/* SHUT_RDWR is fairly recent and is not available on all platforms */
+#if !defined(SHUT_RDWR)
+#define SHUT_RDWR 2
+#endif
+
typedef struct {
uint8_t status;
uint8_t pad0[5];
typedef struct {
uint8_t status;
uint8_t pad0[5];
@@
-247,6
+252,9
@@
void xcb_disconnect(xcb_connection_t *c)
return;
free(c->setup);
return;
free(c->setup);
+
+ /* disallow further sends and receives */
+ shutdown(c->fd, SHUT_RDWR);
close(c->fd);
pthread_mutex_destroy(&c->iolock);
close(c->fd);
pthread_mutex_destroy(&c->iolock);