From f5a1ccd0deb8d82c6befab358e942739ed609b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 10 Feb 2014 14:33:49 -0800 Subject: shm: use shutdown() instead of close() we make sure both ends get notified when the socket is closed by using shutdown() instead of close(). https://bugzilla.gnome.org/show_bug.cgi?id=724077 --- sys/shm/shmpipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/shm') diff --git a/sys/shm/shmpipe.c b/sys/shm/shmpipe.c index d72185999..e75fe308a 100644 --- a/sys/shm/shmpipe.c +++ b/sys/shm/shmpipe.c @@ -429,7 +429,7 @@ sp_writer_close (ShmPipe * self, sp_buffer_free_callback callback, void *user_data) { if (self->main_socket >= 0) - close (self->main_socket); + shutdown (self->main_socket, SHUT_RDWR); if (self->socket_path) { unlink (self->socket_path); @@ -840,7 +840,7 @@ sp_writer_accept_client (ShmPipe * self) return client; error: - close (fd); + shutdown (fd, SHUT_RDWR); return NULL; } @@ -892,7 +892,7 @@ sp_writer_close_client (ShmPipe * self, ShmClient * client, ShmBuffer *buffer = NULL, *prev_buf = NULL; ShmClient *item = NULL, *prev_item = NULL; - close (client->fd); + shutdown (client->fd, SHUT_RDWR); again: for (buffer = self->buffers; buffer; buffer = buffer->next) { -- cgit v1.2.1