diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-23 20:13:54 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-23 21:31:23 +0200 |
commit | 5ad71e4490f3711fbd533d830c0a443cf22f6f2e (patch) | |
tree | ac7ce1827b9302a5935afa317f60ab14199190d6 /src/udev/udev-builtin-btrfs.c | |
parent | udev-builtin-blkid: add more debug log messages (diff) | |
download | systemd-5ad71e4490f3711fbd533d830c0a443cf22f6f2e.tar.xz systemd-5ad71e4490f3711fbd533d830c0a443cf22f6f2e.zip |
udev-builtin-btrfs: add debug log messages
Diffstat (limited to 'src/udev/udev-builtin-btrfs.c')
-rw-r--r-- | src/udev/udev-builtin-btrfs.c | 7 |
1 files 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 <linux/btrfs.h> #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; |