From 0476bae576d4a21ed57cc55074509c07138d1fba Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 13 Oct 2001 17:23:35 +0000 Subject: * fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successful SNDCTL_DSP_GETBLKSIZE operation. Remove obsolete 'name' arg from fhandler_* constructors throughout. * winsup.h (winsock_active): New macro. (winsock2_active): Ditto. * autoload.cc (wsock_init): Use new macros to decide if winsock or winsock2 is loaded. (nonexist_wsock32): Dummy function to force winsock load. (nonexist_ws2_32): Dummy function to force winsock2 load. * fhandler.h (fhandler_socket::fstat): Declare new method. Currently unused. * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check that winsock2 is active before trying WSADuplicateSocketA. (fhandler_socket::fixup_after_fork): Add extra check for winsock2_active. Otherwise use iffy procedures for Windows 95. (fhandler_socket::fixup_after_exec): Add debugging. (fhandler_socket::dup): Add debugging. (fhandler_socket::fstat): New method. (fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on Windows 95. * errno.cc (_sys_nerr): Work around compiler strangeness. * pinfo.cc (winpids::add): Add extra element at end of allocated array for setting to NULL. (winpids::enumNT): Ditto. (winpids::init): Don't modify pidlist if it hasn't been allocated (possibly due to malloc problem). --- winsup/cygwin/errno.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/errno.cc') diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc index 540951c56..0643647b2 100644 --- a/winsup/cygwin/errno.cc +++ b/winsup/cygwin/errno.cc @@ -8,12 +8,16 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#define _sys_nerr FOO_sys_nerr +#define sys_nerr FOOsys_nerr #include "winsup.h" #define _REENT_ONLY #include #include #include "cygerrno.h" #include "thread.h" +#undef _sys_nerr +#undef sys_nerr /* Table to map Windows error codes to Errno values. */ /* FIXME: Doing things this way is a little slow. It's trivial to change @@ -145,7 +149,8 @@ seterrno (const char *file, int line) extern char *_user_strerror _PARAMS ((int)); -extern const NO_COPY char __declspec(dllexport) * const _sys_errlist[]= +extern "C" { +const NO_COPY char __declspec(dllexport) * const _sys_errlist[]= { /* NOERROR 0 */ "No error", /* EPERM 1 */ "Not super-user", @@ -287,8 +292,8 @@ extern const NO_COPY char __declspec(dllexport) * const _sys_errlist[]= /* ECASECLASH 137 */ "Filename exists with different case" }; -int NO_COPY __declspec(dllexport) _sys_nerr = - sizeof (_sys_errlist) / sizeof (_sys_errlist[0]); +extern int const NO_COPY __declspec(dllexport) _sys_nerr = sizeof (_sys_errlist) / sizeof (_sys_errlist[0]); +}; /* FIXME: Why is strerror() a long switch and not just: return sys_errlist[errnum]; -- cgit v1.2.3