Skip to content
Snippets Groups Projects
Commit eaaa6f57 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by gerrit2
Browse files

build(UWP): remove UWP API violations

- Removes some remaining forbidden API calls from the daemon.

Change-Id: I4276e7a439f15c768179dd49ef64863de54f3a77
Tuleap: #790
parent f31b4e74
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#endif // __linux__ #endif // __linux__
#ifdef WIN32 #ifdef _WIN32
#include "winsyslog.h" #include "winsyslog.h"
#endif #endif
......
...@@ -76,6 +76,7 @@ static constexpr const char* AVLOGLEVEL = "AVLOGLEVEL"; ...@@ -76,6 +76,7 @@ static constexpr const char* AVLOGLEVEL = "AVLOGLEVEL";
static void static void
setAvLogLevel() setAvLogLevel()
{ {
#ifndef RING_UWP
char* envvar = getenv(AVLOGLEVEL); char* envvar = getenv(AVLOGLEVEL);
signed level = AV_LOG_WARNING; signed level = AV_LOG_WARNING;
...@@ -86,6 +87,9 @@ setAvLogLevel() ...@@ -86,6 +87,9 @@ setAvLogLevel()
level = std::max(AV_LOG_QUIET, std::min(level, AV_LOG_DEBUG)); level = std::max(AV_LOG_QUIET, std::min(level, AV_LOG_DEBUG));
} }
av_log_set_level(level); av_log_set_level(level);
#else
av_log_set_level(0);
#endif
} }
static void static void
......
...@@ -65,7 +65,9 @@ getLastErrorText( // converts "Lasr Error" code into text ...@@ -65,7 +65,9 @@ getLastErrorText( // converts "Lasr Error" code into text
void closelog(void) void closelog(void)
{ {
#ifndef RING_UWP
DeregisterEventSource(loghdl); DeregisterEventSource(loghdl);
#endif
free(loghdr); free(loghdr);
} }
...@@ -83,6 +85,7 @@ void closelog(void) ...@@ -83,6 +85,7 @@ void closelog(void)
vsprintf(tmp, format, arglist); vsprintf(tmp, format, arglist);
#ifndef RING_UWP
arr[0] = tmp; arr[0] = tmp;
BOOL err = ReportEvent(loghdl, (unsigned short) level, (unsigned short)level, BOOL err = ReportEvent(loghdl, (unsigned short) level, (unsigned short)level,
level, NULL, 1, 0, arr, NULL); level, NULL, 1, 0, arr, NULL);
...@@ -92,6 +95,7 @@ void closelog(void) ...@@ -92,6 +95,7 @@ void closelog(void)
CHAR errText[1024]; CHAR errText[1024];
puts(getLastErrorText(errText, 1024)); puts(getLastErrorText(errText, 1024));
} }
#endif
} }
/* Emulator for BSD openlog() routine /* Emulator for BSD openlog() routine
...@@ -106,7 +110,9 @@ void closelog(void) ...@@ -106,7 +110,9 @@ void closelog(void)
if (loghdl) { if (loghdl) {
closelog(); closelog();
} }
#ifndef RING_UWP
loghdl = RegisterEventSource(NULL, ident); loghdl = RegisterEventSource(NULL, ident);
#endif
sprintf(tmp, (logopt & WINLOG_PID) ? "%s[%d]" : "%s", ident, getpid()); sprintf(tmp, (logopt & WINLOG_PID) ? "%s[%d]" : "%s", ident, getpid());
loghdr = _strdup(tmp); /* save header for later */ loghdr = _strdup(tmp); /* save header for later */
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment