diff options
| author | Manuel Bentele | 2020-09-08 15:07:31 +0200 |
|---|---|---|
| committer | Manuel Bentele | 2020-09-16 07:37:56 +0200 |
| commit | efc492d327ea6a9658674eb9e971aff3742818cd (patch) | |
| tree | 72a3e3e61ee3cbc7df4059ee24ae95487c265b60 /utils/include/debugobj.h | |
| parent | Added file format file format subsystem for loop devices (diff) | |
| download | xloop-efc492d327ea6a9658674eb9e971aff3742818cd.tar.gz xloop-efc492d327ea6a9658674eb9e971aff3742818cd.tar.xz xloop-efc492d327ea6a9658674eb9e971aff3742818cd.zip | |
Added patched losetup utility to configure xloop devices
Diffstat (limited to 'utils/include/debugobj.h')
| -rw-r--r-- | utils/include/debugobj.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/include/debugobj.h b/utils/include/debugobj.h new file mode 100644 index 0000000..73b70b8 --- /dev/null +++ b/utils/include/debugobj.h @@ -0,0 +1,22 @@ +#ifndef UTIL_LINUX_DEBUGOBJ_H +#define UTIL_LINUX_DEBUGOBJ_H + +/* + * Include *after* debug.h and after UL_DEBUG_CURRENT_MASK define. + */ + +static inline void __attribute__ ((__format__ (__printf__, 2, 3))) +ul_debugobj(const void *handler, const char *mesg, ...) +{ + va_list ap; + + if (handler && !(UL_DEBUG_CURRENT_MASK & __UL_DEBUG_FL_NOADDR)) + fprintf(stderr, "[%p]: ", handler); + + va_start(ap, mesg); + vfprintf(stderr, mesg, ap); + va_end(ap); + fputc('\n', stderr); +} + +#endif /* UTIL_LINUX_DEBUGOBJ_H */ |
