aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTino Reichardt <[email protected]>2023-04-05 18:57:01 +0200
committerGitHub <[email protected]>2023-04-05 09:57:01 -0700
commit6ecdd35bdbcdeae0adabefe107677620e88d5548 (patch)
treeabbbed21514d59fd02e69ae130496cb2cceba5ed /include
parent3399a30ee02d0d31ba2d43d0ce0a2fd90d5c575d (diff)
Fix "Add colored output to zfs list"
Running `zfs list -o avail rpool` resulted in a core dump. This commit will fix this. Run the needed overhead only, when `use_color()` is true. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Tino Reichardt <[email protected]> Closes #14712
Diffstat (limited to 'include')
-rw-r--r--include/libzutil.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/libzutil.h b/include/libzutil.h
index 465e463f0..237ff976b 100644
--- a/include/libzutil.h
+++ b/include/libzutil.h
@@ -182,6 +182,7 @@ struct zfs_cmd;
#define ANSI_RESET "\033[0m"
#define ANSI_BOLD "\033[1m"
+_LIBZUTIL_H int use_color(void);
_LIBZUTIL_H void color_start(const char *color);
_LIBZUTIL_H void color_end(void);
_LIBZUTIL_H int printf_color(const char *color, const char *format, ...);