From 3ec97ba6f181cf7dd2b000139790d8abf9758d1b Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 18 Sep 2019 12:05:57 -0400 Subject: [PATCH] Refactor libzfs_error_init newlines Move the trailing newlines from the error message strings to the format strings to more closely match the other error messages. Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Ryan Moeller Closes #9330 --- cmd/mount_zfs/mount_zfs.c | 2 +- cmd/zfs/zfs_main.c | 2 +- cmd/zinject/zinject.c | 2 +- cmd/zpool/zpool_main.c | 2 +- lib/libzfs/libzfs_util.c | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index a9b1e166b..a37dd6f53 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -489,7 +489,7 @@ main(int argc, char **argv) zfsutil = 1; if ((g_zfs = libzfs_init()) == NULL) { - (void) fprintf(stderr, "%s", libzfs_error_init(errno)); + (void) fprintf(stderr, "%s\n", libzfs_error_init(errno)); return (MOUNT_SYSERR); } diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 3dd2b3886..cd8c0aca0 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -8172,7 +8172,7 @@ main(int argc, char **argv) return (zfs_do_version(argc, argv)); if ((g_zfs = libzfs_init()) == NULL) { - (void) fprintf(stderr, "%s", libzfs_error_init(errno)); + (void) fprintf(stderr, "%s\n", libzfs_error_init(errno)); return (1); } diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index cff7f861a..1795bfd45 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -763,7 +763,7 @@ main(int argc, char **argv) uint32_t dvas = 0; if ((g_zfs = libzfs_init()) == NULL) { - (void) fprintf(stderr, "%s", libzfs_error_init(errno)); + (void) fprintf(stderr, "%s\n", libzfs_error_init(errno)); return (1); } diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index b9c7462b6..2c5c88e69 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -9282,7 +9282,7 @@ main(int argc, char **argv) return (zpool_do_version(argc, argv)); if ((g_zfs = libzfs_init()) == NULL) { - (void) fprintf(stderr, "%s", libzfs_error_init(errno)); + (void) fprintf(stderr, "%s\n", libzfs_error_init(errno)); return (1); } diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index eed6282ca..4a9676668 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -69,21 +69,21 @@ libzfs_error_init(int error) case ENXIO: return (dgettext(TEXT_DOMAIN, "The ZFS modules are not " "loaded.\nTry running '/sbin/modprobe zfs' as root " - "to load them.\n")); + "to load them.")); case ENOENT: return (dgettext(TEXT_DOMAIN, "/dev/zfs and /proc/self/mounts " "are required.\nTry running 'udevadm trigger' and 'mount " - "-t proc proc /proc' as root.\n")); + "-t proc proc /proc' as root.")); case ENOEXEC: return (dgettext(TEXT_DOMAIN, "The ZFS modules cannot be " "auto-loaded.\nTry running '/sbin/modprobe zfs' as " - "root to manually load them.\n")); + "root to manually load them.")); case EACCES: return (dgettext(TEXT_DOMAIN, "Permission denied the " - "ZFS utilities must be run as root.\n")); + "ZFS utilities must be run as root.")); default: return (dgettext(TEXT_DOMAIN, "Failed to initialize the " - "libzfs library.\n")); + "libzfs library.")); } }