]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - lib/color.c
lib: Make check_enable_color() return boolean
[mirror_iproute2.git] / lib / color.c
index 9c9023587748fac2744fa6760e42e87bbcfd9d45..eaf69e74d673a6e949e68c504d54777927789b79 100644 (file)
@@ -79,16 +79,16 @@ void enable_color(void)
        set_color_palette();
 }
 
-int check_enable_color(int color, int json)
+bool check_enable_color(int color, int json)
 {
        if (json || color == COLOR_OPT_NEVER)
-               return 1;
+               return false;
 
        if (color == COLOR_OPT_ALWAYS || isatty(fileno(stdout))) {
                enable_color();
-               return 0;
+               return true;
        }
-       return 1;
+       return false;
 }
 
 bool matches_color(const char *arg, int *val)