From 5ad71e4490f3711fbd533d830c0a443cf22f6f2e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 24 Oct 2018 03:13:54 +0900 Subject: [PATCH] udev-builtin-btrfs: add debug log messages --- src/udev/udev-builtin-btrfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c index 4380eb0be4..69bd54244f 100644 --- a/src/udev/udev-builtin-btrfs.c +++ b/src/udev/udev-builtin-btrfs.c @@ -8,6 +8,7 @@ #include #endif +#include "device-util.h" #include "fd-util.h" #include "missing.h" #include "string-util.h" @@ -21,16 +22,16 @@ static int builtin_btrfs(sd_device *dev, int argc, char *argv[], bool test) { int r; if (argc != 3 || !streq(argv[1], "ready")) - return -EINVAL; + return log_device_error_errno(dev, EINVAL, "Invalid arguments"); fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC); if (fd < 0) - return -errno; + return log_device_debug_errno(dev, errno, "Failed to open /dev/btrfs-control: %m"); strscpy(args.name, sizeof(args.name), argv[2]); r = ioctl(fd, BTRFS_IOC_DEVICES_READY, &args); if (r < 0) - return -errno; + return log_device_debug_errno(dev, errno, "Failed to call BTRFS_IOC_DEVICES_READY: %m"); udev_builtin_add_property(dev, test, "ID_BTRFS_READY", one_zero(r == 0)); return 0; -- 2.25.1