diff options
Diffstat (limited to 'liblog/fake_log_device.c')
-rw-r--r-- | liblog/fake_log_device.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c index da83a85..b8d87bb 100644 --- a/liblog/fake_log_device.c +++ b/liblog/fake_log_device.c @@ -21,18 +21,22 @@ */ #include "fake_log_device.h" -#include <log/logd.h> - -#include <stdlib.h> -#include <string.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <stdlib.h> +#include <string.h> + +#include <log/logd.h> #ifdef HAVE_PTHREADS #include <pthread.h> #endif +#ifndef __unused +#define __unused __attribute__((__unused__)) +#endif + #define kMaxTagLen 16 /* from the long-dead utils/Log.cpp */ #define kTagSetSize 16 /* arbitrary */ @@ -348,7 +352,7 @@ static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { static void showLog(LogState *state, int logPrio, const char* tag, const char* msg) { -#if defined(HAVE_LOCALTIME_R) +#if !defined(_WIN32) struct tm tmBuf; #endif struct tm* ptm; @@ -373,7 +377,7 @@ static void showLog(LogState *state, * in the time stamp. Don't use forward slashes, parenthesis, * brackets, asterisks, or other special chars here. */ -#if defined(HAVE_LOCALTIME_R) +#if !defined(_WIN32) ptm = localtime_r(&when, &tmBuf); #else ptm = localtime(&when); @@ -613,7 +617,7 @@ static int logClose(int fd) /* * Open a log output device and return a fake fd. */ -static int logOpen(const char* pathName, int flags) +static int logOpen(const char* pathName, int flags __unused) { LogState *logState; int fd = -1; |