From 7425d85729b57ecb8eed1ea5ade84b3cf0bb9381 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 24 Jul 2022 17:45:18 +0200 Subject: [PATCH] Silence zpool errors This can print "internal error: failed to initialize ZFS library" on NetBSD. Let's just silence it. --- share/functions/__fish_is_zfs_feature_enabled.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_is_zfs_feature_enabled.fish b/share/functions/__fish_is_zfs_feature_enabled.fish index d6f02af7c..29e63a494 100644 --- a/share/functions/__fish_is_zfs_feature_enabled.fish +++ b/share/functions/__fish_is_zfs_feature_enabled.fish @@ -2,9 +2,9 @@ function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the gi set -l pool (string replace -r '/.*' '' -- $target) set -l feature_name "" if test -z "$pool" - set feature_name (zpool get -H all | string match -r "\s$feature\s") + set feature_name (zpool get -H all 2>/dev/null | string match -r "\s$feature\s") else - set feature_name (zpool get -H all $pool | string match -r "$pool\s$feature\s") + set feature_name (zpool get -H all $pool 2>/dev/null | string match -r "$pool\s$feature\s") end if test $status -ne 0 # No such feature return 1