Commit Graph

22 Commits (master)

Author SHA1 Message Date
Karel Zak faeb1b64b3 include: add missing license lines
The header files are usually based on code from lib/. This commit
copies relevant license headers from lib/ to include/ to keep
things consistent. The very generic things (e.g. MBR definitions)
are always public domain.

Signed-off-by: Karel Zak <>
2023-01-12 15:33:09 +01:00
Karel Zak 45c1fe0c1b libmount: add optlist tests
Signed-off-by: Karel Zak <>
2023-01-03 12:53:12 +01:00
Karel Zak a15dca2f6d include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()
Let's make it possible to use debug.h without environment variables.

Suggested-by: J William Piggott <>
Signed-off-by: Karel Zak <>
2018-01-17 13:58:29 +01:00
Karel Zak 7bd0c1ae18 include/debug: improve debug message
Signed-off-by: Karel Zak <>
2018-01-12 13:46:49 +01:00
Karel Zak 66643f3151 include/debug: print info when addresses suppressed
Suggested-by: Peter Cordes <>
Signed-off-by: Karel Zak <>
2018-01-12 13:37:05 +01:00
Karel Zak 6d00cfb233 include/debug: don't print pointer address for SUID programs
* introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing


* move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK
  to provide access to the current mask from ul_debugobj(). It's better
  than modify all ul_debugobj() calls and use the global mask as

* remove never used UL_DEBUG_DEFINE_FLAG

Reported-by: halfdog <>
Signed-off-by: Karel Zak <>
2018-01-12 11:01:26 +01:00
Igor Gnatenko 0e0943c15b debug: use const void * for ul_debugobj()
We don't modify data it's pointing out and we should not modify it.

Also remove casting to void * as gcc will do it automatically (before
we had to cast it explicitly to avoid warning on discarding 'const'

Signed-off-by: Igor Gnatenko <>
2016-09-21 08:22:35 +02:00
Sebastian Rasmussen 9e93004171 misc: Fix various typos
Fix various typos in error messages, warnings, debug strings,
comments and names of static functions.

Signed-off-by: Sebastian Rasmussen <>
2016-05-31 23:40:21 +02:00
Karel Zak ef316a27de include/debug: improve and cleanup
* use ul_debug_ prefix for all routines
* support <NAME>_DEBUG=all also for programs without debug mask names
  (so we can avoid 0xffff mask in man pages)
* add function to print debug help

Signed-off-by: Karel Zak <>
2014-11-03 12:51:17 +01:00
Karel Zak 819d9a2975 include/debug: fix typo
Signed-off-by: Karel Zak <>
2014-10-24 11:19:23 +02:00
Karel Zak 3635f53ca2 whereis: cleanup debug stuff, fix argv[] usage
* use debug stuff from include/debug.h and make whereis(1) sensitive
  to WHEREIS_DEBUG=0xffff mask

* fix problem with argv[] usage

  # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc
  bin: /usr/local/bin
  gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz

the code ignores "-B" and /usr/bin is interpreted as search pattern,
expected result is:

  # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc
  gcc: /usr/share/man/man1/gcc.1.gz /usr/bin/gcc

Signed-off-by: Karel Zak <>
2014-10-23 13:44:00 +02:00
Sami Kerola aeeb81317e include/debug: remove duplicate 'const' declaration warning
./include/debug.h:89:55: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]

Signed-off-by: Sami Kerola <>
2014-10-01 13:09:35 +02:00
Karel Zak 1e06330329 include/debug: allow to speficy empty masknames
Signed-off-by: Karel Zak <>
2014-08-13 14:19:21 +02:00
Karel Zak 03e4220d29 include/debug: cleanup masks
Signed-off-by: Karel Zak <>
2014-08-13 14:13:32 +02:00
Karel Zak 6d577b7089 include/debug: make masknames optional
Signed-off-by: Karel Zak <>
2014-08-13 13:51:42 +02:00
Ondrej Oprala 14ad2353cc libs/debug: accept human readable names for _DEBUG=
For example
	$ LIBMOUNT_DEBUG=tab,cache findmnt

to debug only TAB and CACHE subsystem.

Signed-off-by: Ondrej Oprala <>
Signed-off-by: Karel Zak <>
2014-08-13 12:33:47 +02:00
Karel Zak e7b49879ad include/debug: add another debug macros
Signed-off-by: Karel Zak <>
2014-03-21 12:04:12 +01:00
Karel Zak d282c88df5 include/debug: fix coding style
Signed-off-by: Karel Zak <>
2014-03-21 11:21:56 +01:00
Ondrej Oprala 274228fecc clean up redundant macros and defines
Signed-off-by: Ondrej Oprala <>
2014-03-13 11:53:31 +01:00
Ondrej Oprala b681c25834 libcommon: don't mention lib versions in debug macros
Signed-off-by: Ondrej Oprala <>
2014-03-13 10:42:11 +01:00
Ondrej Oprala cb3fa84753 libcommon: define more debugging macros
Signed-off-by: Ondrej Oprala <>
2014-03-12 15:40:40 +01:00
Ondrej Oprala db08389d87 libcommon: add common debugging routines
Signed-off-by: Ondrej Oprala <>
2014-03-12 14:37:41 +01:00