mirror of
https://github.com/xemu-project/xemu.git
synced 2024-12-11 21:44:04 +00:00
09863ebc7e
All of the fuse files include config.h and define GNU_SOURCE where we don't have either under our build - remove them. Fixup path to the kernel's fuse.h in the QEMUs world. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
42 lines
793 B
C
42 lines
793 B
C
/*
|
|
* FUSE: Filesystem in Userspace
|
|
* Copyright (C) 2019 Red Hat, Inc.
|
|
*
|
|
* Logging API.
|
|
*
|
|
* This program can be distributed under the terms of the GNU LGPLv2.
|
|
* See the file COPYING.LIB
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "fuse_log.h"
|
|
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
|
|
static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
|
|
const char *fmt, va_list ap)
|
|
{
|
|
vfprintf(stderr, fmt, ap);
|
|
}
|
|
|
|
static fuse_log_func_t log_func = default_log_func;
|
|
|
|
void fuse_set_log_func(fuse_log_func_t func)
|
|
{
|
|
if (!func) {
|
|
func = default_log_func;
|
|
}
|
|
|
|
log_func = func;
|
|
}
|
|
|
|
void fuse_log(enum fuse_log_level level, const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
log_func(level, fmt, ap);
|
|
va_end(ap);
|
|
}
|