summaryrefslogtreecommitdiffstats
path: root/lib/libfuse/debug.c
diff options
context:
space:
mode:
authorhelg <helg@openbsd.org>2017-12-13 12:30:18 +0000
committerhelg <helg@openbsd.org>2017-12-13 12:30:18 +0000
commitc839d22f400af536a5e6b6a85044549c984c0d01 (patch)
treee1b7729a2f53db1707283fef9e50ac9a333006f7 /lib/libfuse/debug.c
parentIf the list of templates 'o' passed to fuse_opt_parse(3) is NULL then (diff)
downloadwireguard-openbsd-c839d22f400af536a5e6b6a85044549c984c0d01.tar.xz
wireguard-openbsd-c839d22f400af536a5e6b6a85044549c984c0d01.zip
Add support for the -d (-o debug) option to libfuse. Currently works for FUSE
file systems that call fuse_parse_cmdline(3), fuse_main(3) or fuse_setup(3). ok mpi@, jca@
Diffstat (limited to 'lib/libfuse/debug.c')
-rw-r--r--lib/libfuse/debug.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libfuse/debug.c b/lib/libfuse/debug.c
index e6262136451..d7829116398 100644
--- a/lib/libfuse/debug.c
+++ b/lib/libfuse/debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: debug.c,v 1.1 2013/06/03 16:00:50 tedu Exp $ */
+/* $OpenBSD: debug.c,v 1.2 2017/12/13 12:30:18 helg Exp $ */
/*
* Copyright (c) 2011 Alexandre Ratchov <alex@caoua.org>
*
@@ -20,7 +20,6 @@
#include "debug.h"
-#ifdef DEBUG
/*
* debug level, -1 means uninitialized
*/
@@ -31,10 +30,10 @@ ifuse_debug_init(void)
{
char *dbg;
+ /* Default to level 1 unless FUSE_DEBUG environment variable is set. */
if (ifuse_debug < 0) {
dbg = issetugid() ? NULL : getenv("FUSE_DEBUG");
if (!dbg || sscanf(dbg, "%u", &ifuse_debug) != 1)
- ifuse_debug = 0;
+ ifuse_debug = 1;
}
}
-#endif