From 14892c1dc88f83a19cf1c055debc39b3e72b2ff4 Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Thu, 1 Jul 2004 16:17:54 +0000 Subject: [PATCH] glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) Initialize 2004-07-01 John Ehresman * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) Initialize reset_send & reset_recv fields and don't close sockets unless they were created. (#145153) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/giowin32.c | 6 ++++-- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 973bbf53b..7ce25f7a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-07-01 John Ehresman + + * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) + Initialize reset_send & reset_recv fields and don't close + sockets unless they were created. (#145153) + Fri Jun 11 22:56:46 2004 Matthias Clasen * glib/gscanner.c (g_scanner_get_token_ll): Ignore a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 973bbf53b..7ce25f7a2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2004-07-01 John Ehresman + + * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) + Initialize reset_send & reset_recv fields and don't close + sockets unless they were created. (#145153) + Fri Jun 11 22:56:46 2004 Matthias Clasen * glib/gscanner.c (g_scanner_get_token_ll): Ignore a diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 973bbf53b..7ce25f7a2 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2004-07-01 John Ehresman + + * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) + Initialize reset_send & reset_recv fields and don't close + sockets unless they were created. (#145153) + Fri Jun 11 22:56:46 2004 Matthias Clasen * glib/gscanner.c (g_scanner_get_token_ll): Ignore a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 973bbf53b..7ce25f7a2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2004-07-01 John Ehresman + + * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) + Initialize reset_send & reset_recv fields and don't close + sockets unless they were created. (#145153) + Fri Jun 11 22:56:46 2004 Matthias Clasen * glib/gscanner.c (g_scanner_get_token_ll): Ignore a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 973bbf53b..7ce25f7a2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2004-07-01 John Ehresman + + * glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free) + Initialize reset_send & reset_recv fields and don't close + sockets unless they were created. (#145153) + Fri Jun 11 22:56:46 2004 Matthias Clasen * glib/gscanner.c (g_scanner_get_token_ll): Ignore a diff --git a/glib/giowin32.c b/glib/giowin32.c index f1ec3678a..ea05f9c4c 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -183,6 +183,8 @@ g_io_channel_win32_init (GIOWin32Channel *channel) channel->data_avail_event = NULL; channel->revents = 0; channel->space_avail_event = NULL; + channel->reset_send = INVALID_SOCKET; + channel->reset_recv = INVALID_SOCKET; channel->data_avail_noticed_event = NULL; channel->watches = NULL; InitializeCriticalSection (&channel->mutex); @@ -861,9 +863,9 @@ g_io_win32_free (GIOChannel *channel) win32_channel->thread_id, win32_channel->fd); - if (win32_channel->reset_send) + if (win32_channel->reset_send && win32_channel->reset_send != INVALID_SOCKET) closesocket (win32_channel->reset_send); - if (win32_channel->reset_recv) + if (win32_channel->reset_recv && win32_channel->reset_recv != INVALID_SOCKET) closesocket (win32_channel->reset_recv); if (win32_channel->data_avail_event) CloseHandle (win32_channel->data_avail_event);