2
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
4
* This file may be redistributed under the terms of the
5
* GNU Lesser General Public License.
10
* @title: Library initialization
11
* @short_description: initialize debuging
19
int libmount_debug_mask;
23
* @mask: debug mask (0xffff to enable full debuging)
25
* If the @mask is not specified then this function reads
26
* LIBMOUNT_DEBUG environment variable to get the mask.
28
* Already initialized debugging stuff cannot be changed. It does not
29
* have effect to call this function twice.
31
void mnt_init_debug(int mask)
33
if (libmount_debug_mask & MNT_DEBUG_INIT)
36
char *str = getenv("LIBMOUNT_DEBUG");
38
libmount_debug_mask = strtoul(str, 0, 0);
40
libmount_debug_mask = mask;
42
if (libmount_debug_mask)
43
printf("libmount: debug mask set to 0x%04x.\n",
45
libmount_debug_mask |= MNT_DEBUG_INIT;