1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

trac 29 avoid syslog in echo test if win32

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-04-30 06:53:56 +08:00
parent d91561c2f6
commit 70d6717afb

View file

@ -29,7 +29,10 @@
#include <string.h>
#include <sys/time.h>
#include <assert.h>
#ifdef WIN32
#else
#include <syslog.h>
#endif
#include <signal.h>
#ifdef CMAKE_BUILD
@ -255,13 +258,15 @@ int main(int argc, char **argv)
}
#endif
#ifdef WIN32
#else
/* we will only try to log things according to our debug_level */
setlogmask(LOG_UPTO (LOG_DEBUG));
openlog("lwsts", syslog_options, LOG_DAEMON);
/* tell the library what debug level to emit and to send it to syslog */
lws_set_log_level(debug_level, lwsl_emit_syslog);
#endif
lwsl_notice("libwebsockets echo test - "
"(C) Copyright 2010-2013 Andy Green <andy@warmcat.com> - "
"licensed under LGPL2.1\n");
@ -340,8 +345,10 @@ bail:
libwebsocket_context_destroy(context);
lwsl_notice("libwebsockets-test-echo exited cleanly\n");
#ifdef WIN32
#else
closelog();
#endif
return 0;
}