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
18
int libmount_debug_mask;
22
* @mask: debug mask (0xffff to enable full debuging)
24
* If the @mask is not specified then this function reads
25
* LIBMOUNT_DEBUG environment variable to get the mask.
27
* Already initialized debugging stuff cannot be changed. It does not
28
* have effect to call this function twice.
30
void mnt_init_debug(int mask)
32
if (libmount_debug_mask & MNT_DEBUG_INIT)
35
char *str = getenv("LIBMOUNT_DEBUG");
37
libmount_debug_mask = strtoul(str, 0, 0);
39
libmount_debug_mask = mask;
41
if (libmount_debug_mask)
42
printf("libmount: debug mask set to 0x%04x.\n",
44
libmount_debug_mask |= MNT_DEBUG_INIT;