mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
devicemapper: remove 256 character limit of libdm logs
This limit is unecessary and can lead to the truncation of long libdm
logs (which is quite annoying).
Fixes: b440ec013
("device-mapper: Move all devicemapper spew to log through utils.Debugf().")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
parent
8bc681262f
commit
63328c6882
1 changed files with 9 additions and 7 deletions
|
@ -4,6 +4,7 @@ package devicemapper
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#cgo LDFLAGS: -L. -ldevmapper
|
#cgo LDFLAGS: -L. -ldevmapper
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <libdevmapper.h>
|
#include <libdevmapper.h>
|
||||||
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it?
|
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it?
|
||||||
|
|
||||||
|
@ -12,19 +13,20 @@ extern void DevmapperLogCallback(int level, char *file, int line, int dm_errno_o
|
||||||
|
|
||||||
static void log_cb(int level, const char *file, int line, int dm_errno_or_class, const char *f, ...)
|
static void log_cb(int level, const char *file, int line, int dm_errno_or_class, const char *f, ...)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char *buffer = NULL;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, f);
|
va_start(ap, f);
|
||||||
vsnprintf(buffer, 256, f, ap);
|
vasprintf(&buffer, f, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
|
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
|
||||||
|
free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void log_with_errno_init()
|
static void log_with_errno_init()
|
||||||
{
|
{
|
||||||
dm_log_with_errno_init(log_cb);
|
dm_log_with_errno_init(log_cb);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
Loading…
Reference in a new issue