From: Ryan Moeller Date: Wed, 18 Sep 2019 16:05:57 +0000 (-0400) Subject: Refactor libzfs_error_init newlines X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afc8f0a6ffb4dd2dd5e17abc39e035eb7c7bcdc8;p=zfs 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 --- 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 e6b597825..62c5bcca4 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -8308,7 +8308,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 5ffde8bf3..c28560a15 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -9757,7 +9757,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 27d630d4f..de4d8bff9 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.")); } }