From 0f4eefb09464828ce07ad5b8763423e0d1d68e61 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 15 Mar 2010 13:08:51 +0000 Subject: Builds again for W32. --- common/logging.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'common/logging.c') diff --git a/common/logging.c b/common/logging.c index 6bc35eee5..bf47015e7 100644 --- a/common/logging.c +++ b/common/logging.c @@ -30,19 +30,27 @@ #include #include #ifndef HAVE_W32_SYSTEM -#include -#include -#endif /*!HAVE_W32_SYSTEM*/ +# include +# include +#endif /*HAVE_W32_SYSTEM*/ #include #include #include + #define JNLIB_NEED_LOG_LOGV 1 #define JNLIB_NEED_AFLOCAL 1 #include "libjnlib-config.h" #include "logging.h" +#ifdef HAVE_W32_SYSTEM +# define S_IRGRP S_IRUSR +# define S_IROTH S_IRUSR +# define S_IWGRP S_IWUSR +# define S_IWOTH S_IWUSR +#endif + static estream_t logstream; static int log_socket = -1; @@ -121,6 +129,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size) processes often close stderr and by writing to file descriptor 2 we might send the log message to a file not intended for logging (e.g. a pipe or network connection). */ +#ifndef HAVE_W32_SYSTEM if (cookie->want_socket && cookie->fd == -1) { /* Not yet open or meanwhile closed due to an error. */ @@ -177,6 +186,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size) cookie->is_socket = 1; } } +#endif /*HAVE_W32_SYSTEM*/ log_socket = cookie->fd; if (cookie->fd != -1 && !writen (cookie->fd, buffer, size)) @@ -239,6 +249,7 @@ set_file_fd (const char *name, int fd) fd = fileno (stderr); } +#ifndef HAVE_W32_SYSTEM if (name) { want_socket = (!strncmp (name, "socket://", 9) && name[9]); @@ -246,6 +257,7 @@ set_file_fd (const char *name, int fd) name += 9; } else +#endif /*HAVE_W32_SYSTEM*/ { want_socket = 0; } -- cgit v1.2.3