Compare commits
No commits in common. "14f1c1a3580625c1976293dcb4c3bdbce9ddc010" and "64d3a5c8b7edf48378065d604c545428efbe5ec1" have entirely different histories.
14f1c1a358
...
64d3a5c8b7
|
|
@ -10,7 +10,6 @@ CONFIGURE_OPTIONS=(
|
||||||
)
|
)
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
CFLAGS='-shared-libgcc' \
|
|
||||||
meson setup \
|
meson setup \
|
||||||
--reconfigure \
|
--reconfigure \
|
||||||
--cross-file "$MESON_CROSS_FILE" \
|
--cross-file "$MESON_CROSS_FILE" \
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
#define LOG_PID 0x01
|
#define LOG_PID 0x01
|
||||||
|
|
@ -49,7 +47,6 @@ void closelog(void);
|
||||||
void openlog(const char* ident, int logopt, int facility);
|
void openlog(const char* ident, int logopt, int facility);
|
||||||
int setlogmask(int maskpri);
|
int setlogmask(int maskpri);
|
||||||
void syslog(int priority, const char* message, ...);
|
void syslog(int priority, const char* message, ...);
|
||||||
void vsyslog(int priority, const char* format, va_list ap);
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
@ -16,31 +17,24 @@ void openlog(const char* ident, int option, int facility)
|
||||||
s_ident = ident;
|
s_ident = ident;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void syslog(int priority, const char* format, ...)
|
||||||
|
{
|
||||||
|
(void)priority;
|
||||||
|
if (s_ident)
|
||||||
|
fprintf(s_log_file, "%s: ", s_ident);
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
vfprintf(s_log_file, format, args);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
const size_t format_len = strlen(format);
|
||||||
|
if (format_len && format[format_len - 1] != '\n')
|
||||||
|
fputc('\n', s_log_file);
|
||||||
|
}
|
||||||
|
|
||||||
void closelog()
|
void closelog()
|
||||||
{
|
{
|
||||||
fclose(s_log_file);
|
fclose(s_log_file);
|
||||||
s_log_file = nullptr;
|
s_log_file = nullptr;
|
||||||
s_ident = nullptr;
|
s_ident = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void syslog(int priority, const char* format, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
vsyslog(priority, format, args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void vsyslog(int priority, const char* format, va_list ap)
|
|
||||||
{
|
|
||||||
(void)priority;
|
|
||||||
|
|
||||||
if (s_ident)
|
|
||||||
fprintf(s_log_file, "%s: ", s_ident);
|
|
||||||
|
|
||||||
vfprintf(s_log_file, format, ap);
|
|
||||||
|
|
||||||
const size_t format_len = strlen(format);
|
|
||||||
if (format_len && format[format_len - 1] != '\n')
|
|
||||||
fputc('\n', s_log_file);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue