summaryrefslogblamecommitdiffstats
path: root/shlibs/mount/src/init.c
blob: 544361bc7af3a915253075cecfea20a09a2bfaf8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                        

















                                                                 
/*
 * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
 *
 * This file may be redistributed under the terms of the
 * GNU Lesser General Public License.
 */

#include <stdlib.h>

#include "mountP.h"

int libmount_debug_mask;

void mnt_init_debug(int mask)
{
	if (libmount_debug_mask & DEBUG_INIT)
		return;
	if (!mask) {
		char *str = mnt_getenv_safe("LIBMOUNT_DEBUG");
		if (str)
			libmount_debug_mask = strtoul(str, 0, 0);
	} else
		libmount_debug_mask = mask;

	if (libmount_debug_mask)
		printf("libmount: debug mask set to 0x%04x.\n",
				libmount_debug_mask);
	libmount_debug_mask |= DEBUG_INIT;
}