X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=cmds-device.c;h=86459d1b956430585c5649986dbd346a16cb6409;hb=6bcb03dda1f92ee50819748edb55c5a99820b1ed;hp=f4cdb39f64aca6ca41a30700878c043237c32e20;hpb=2192bd5cfc344e6352ccba044c21195cca7ebe2d;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/cmds-device.c b/cmds-device.c index f4cdb39..86459d1 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -120,8 +120,8 @@ static int cmd_device_add(int argc, char **argv) path = canonicalize_path(argv[i]); if (!path) { - error("could not canonicalize pathname '%s': %s", - argv[i], strerror(errno)); + error("could not canonicalize pathname '%s': %m", + argv[i]); ret++; goto error_out; } @@ -130,8 +130,7 @@ static int cmd_device_add(int argc, char **argv) strncpy_null(ioctl_args.name, path); res = ioctl(fdmnt, BTRFS_IOC_ADD_DEV, &ioctl_args); if (res < 0) { - error("error adding device '%s': %s", - path, strerror(errno)); + error("error adding device '%s': %m", path); ret++; } free(path); @@ -192,8 +191,7 @@ static int _cmd_device_remove(int argc, char **argv, */ if (res < 0 && (errno == ENOTTY || errno == EOPNOTSUPP)) { if (is_devid) { - error("device delete by id failed: %s", - strerror(errno)); + error("device delete by id failed: %m"); ret++; continue; } @@ -311,8 +309,7 @@ static int cmd_device_scan(int argc, char **argv) } path = canonicalize_path(argv[i]); if (!path) { - error("could not canonicalize path '%s': %s", - argv[i], strerror(errno)); + error("could not canonicalize path '%s': %m", argv[i]); ret = 1; goto out; } @@ -355,8 +352,8 @@ static int cmd_device_ready(int argc, char **argv) path = canonicalize_path(argv[optind]); if (!path) { - error("could not canonicalize pathname '%s': %s", - argv[optind], strerror(errno)); + error("could not canonicalize pathname '%s': %m", + argv[optind]); ret = 1; goto out; } @@ -371,8 +368,8 @@ static int cmd_device_ready(int argc, char **argv) strncpy_null(args.name, path); ret = ioctl(fd, BTRFS_IOC_DEVICES_READY, &args); if (ret < 0) { - error("unable to determine if device '%s' is ready for mount: %s", - path, strerror(errno)); + error("unable to determine if device '%s' is ready for mount: %m", + path); ret = 1; } @@ -466,8 +463,8 @@ static int cmd_device_stats(int argc, char **argv) args.flags = flags; if (ioctl(fdmnt, BTRFS_IOC_GET_DEV_STATS, &args) < 0) { - error("device stats ioctl failed on %s: %s", - path, strerror(errno)); + error("device stats ioctl failed on %s: %m", + path); err |= 1; } else { char *canonical_path;