From ff91a22e073349fc5339ec55d65392c23fdcb6db Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 19 Jul 2001 08:39:04 +0000 Subject: [PATCH] updates. --- includes/silcincludes.h | 4 ++++ lib/silcclient/client.h | 2 +- lib/silcutil/silclog.c | 3 +++ lib/silcutil/win32/silcwin32schedule.c | 12 +++++++----- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/includes/silcincludes.h b/includes/silcincludes.h index 20855d04..fb326df6 100644 --- a/includes/silcincludes.h +++ b/includes/silcincludes.h @@ -176,19 +176,23 @@ typedef unsigned long uint32; typedef signed long int32; #else #if SILC_SIZEOF_LONG_LONG >= 4 +#ifndef WIN32 typedef unsigned long long uint32; typedef signed long long int32; #endif #endif #endif +#endif #if SILC_SIZEOF_LONG >= 8 typedef unsigned long uint64; typedef signed long int64; #else #if SILC_SIZEOF_LONG_LONG >= 8 +#ifndef WIN32 typedef unsigned long long uint64; typedef signed long long int64; +#endif #else typedef uint32 uint64; typedef int32 int64; diff --git a/lib/silcclient/client.h b/lib/silcclient/client.h index 89195d05..f78135f5 100644 --- a/lib/silcclient/client.h +++ b/lib/silcclient/client.h @@ -282,7 +282,7 @@ void silc_client_remove_from_channels(SilcClient client, void silc_client_replace_from_channels(SilcClient client, SilcClientConnection conn, SilcClientEntry old, - SilcClientEntry new); + SilcClientEntry newclient); void silc_client_process_failure(SilcClient client, SilcSocketConnection sock, SilcPacketContext *packet); diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 91b254d5..a0c9181a 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -95,6 +95,9 @@ void silc_log_output(const char *filename, uint32 maxsize, break; } + if (!filename) + filename = " "; + /* Purge the log file if the max size is defined. */ if (maxsize) { fp = fopen(filename, "r"); diff --git a/lib/silcutil/win32/silcwin32schedule.c b/lib/silcutil/win32/silcwin32schedule.c index 9321fecb..4c835146 100644 --- a/lib/silcutil/win32/silcwin32schedule.c +++ b/lib/silcutil/win32/silcwin32schedule.c @@ -20,7 +20,7 @@ /* $Id$ */ #include "silcincludes.h" -#includd "silcschedule_i.h" +#include "silcschedule_i.h" /* Our "select()" for WIN32. This mimics the behaviour of select() system call. It does not call the Winsock's select() though. Its functions @@ -65,10 +65,13 @@ int silc_select(SilcScheduleFd fds, uint32 fds_count, struct timeval *timeout) continue; if (fds[i].events & SILC_TASK_READ) - handles[nhandles++] = (HANDLE)i; + handles[nhandles++] = (HANDLE)fds[i].fd; - if (fds[i].events & SILC_TASK_WRITE) + /* If writing then just set the bit and return */ + if (fds[i].events & SILC_TASK_WRITE) { + fds[i].revents = SILC_TASK_WRITE; return 1; + } fds[i].revents = 0; } @@ -140,8 +143,7 @@ int silc_select(SilcScheduleFd fds, uint32 fds_count, struct timeval *timeout) /* Give the wait another try */ goto retry; - } else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles && - readfds) { + } else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles) { /* Some other event, like SOCKET or something. */ /* Go through all fds even though only one was set. This is to avoid -- 2.24.0