From beed3997ab5bbc37671f8cf4d0db5dbcb0866d16 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 31 Jul 2000 15:11:02 +0000 Subject: [PATCH] The code didn't compile (must have been sleepy when committing). "return" 2000-07-31 Tor Lillqvist * giowin32.c (buffer_read): The code didn't compile (must have been sleepy when committing). "return" instead of "break" (g_io_win32_fd_add_watch): Cannot check if the file descriptor is readable by calling ReadFile to read zero bytes. ReadFile blocks on NT even if trying to read nothing at all. So, don't check if file descriptor is readable; assume this function isn't called otherwise. --- ChangeLog | 11 +++++++++++ ChangeLog.pre-2-0 | 11 +++++++++++ ChangeLog.pre-2-10 | 11 +++++++++++ ChangeLog.pre-2-12 | 11 +++++++++++ ChangeLog.pre-2-2 | 11 +++++++++++ ChangeLog.pre-2-4 | 11 +++++++++++ ChangeLog.pre-2-6 | 11 +++++++++++ ChangeLog.pre-2-8 | 11 +++++++++++ giowin32.c | 10 +++++----- glib/giowin32.c | 10 +++++----- 10 files changed, 98 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2afe46..34c24d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c2afe46..34c24d2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +2000-07-31 Tor Lillqvist + + * giowin32.c (buffer_read): The code didn't compile (must + have been sleepy when committing). "return" instead of "break" + + (g_io_win32_fd_add_watch): Cannot check if the file descriptor is + readable by calling ReadFile to read zero bytes. ReadFile blocks + on NT even if trying to read nothing at all. So, don't check if + file descriptor is readable; assume this function isn't called + otherwise. + Sun Jul 30 10:44:16 2000 Tim Janik * gmain.c (g_get_current_time): fix tor's recent changes which diff --git a/giowin32.c b/giowin32.c index 3d64431..ea00711 100644 --- a/giowin32.c +++ b/giowin32.c @@ -273,7 +273,10 @@ buffer_read (GIOWin32Channel *channel, WaitForSingleObject (channel->data_avail_event, INFINITE); LOCK (channel->mutex); if (channel->rdp == channel->wrp && !channel->running) - break; + { + UNLOCK (channel->mutex); + return 0; + } } if (channel->rdp < channel->wrp) @@ -635,10 +638,7 @@ g_io_win32_fd_add_watch (GIOChannel *channel, g_print ("g_io_win32_fd_add_watch: fd:%d handle:%#x\n", win32_channel->fd, watch->pollfd.fd); - /* Is it readable? (Would be strange to watch it otherwise, but... */ - if (ReadFile ((HANDLE) _get_osfhandle (win32_channel->fd), - dummy, 0, &nbytes, NULL)) - create_reader_thread (win32_channel, fd_reader); + create_reader_thread (win32_channel, fd_reader); g_main_add_poll (&watch->pollfd, priority); diff --git a/glib/giowin32.c b/glib/giowin32.c index 3d64431..ea00711 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -273,7 +273,10 @@ buffer_read (GIOWin32Channel *channel, WaitForSingleObject (channel->data_avail_event, INFINITE); LOCK (channel->mutex); if (channel->rdp == channel->wrp && !channel->running) - break; + { + UNLOCK (channel->mutex); + return 0; + } } if (channel->rdp < channel->wrp) @@ -635,10 +638,7 @@ g_io_win32_fd_add_watch (GIOChannel *channel, g_print ("g_io_win32_fd_add_watch: fd:%d handle:%#x\n", win32_channel->fd, watch->pollfd.fd); - /* Is it readable? (Would be strange to watch it otherwise, but... */ - if (ReadFile ((HANDLE) _get_osfhandle (win32_channel->fd), - dummy, 0, &nbytes, NULL)) - create_reader_thread (win32_channel, fd_reader); + create_reader_thread (win32_channel, fd_reader); g_main_add_poll (&watch->pollfd, priority); -- 2.7.4