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;
}
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);
*/
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;
}
}
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;
}
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;
}
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;
}
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;