summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/colors.h3
-rw-r--r--lib/colors.c20
-rw-r--r--libfdisk/src/gpt.c6
-rw-r--r--misc-utils/cal.c18
-rw-r--r--sys-utils/mount.88
5 files changed, 42 insertions, 13 deletions
diff --git a/include/colors.h b/include/colors.h
index 3636beb55..d4ae4e407 100644
--- a/include/colors.h
+++ b/include/colors.h
@@ -38,6 +38,9 @@ extern int colors_init(int mode, const char *util_name);
/* Returns 1 or 0 */
extern int colors_wanted(void);
+/* Returns UL_COLORMODE_* */
+extern int colors_mode(void);
+
/* temporary enable/disable colors */
extern void colors_off(void);
extern void colors_on(void);
diff --git a/lib/colors.c b/lib/colors.c
index f636ecc4f..bea7bd1d7 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -653,9 +653,6 @@ static int colors_terminal_is_ready(void)
{
int ncolors = -1;
- if (isatty(STDOUT_FILENO) != 1)
- goto none;
-
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
{
int ret;
@@ -692,11 +689,16 @@ int colors_init(int mode, const char *name)
struct ul_color_ctl *cc = &ul_colors;
cc->utilname = name;
- cc->mode = mode;
termcolors_init_debug();
- if (mode == UL_COLORMODE_UNDEF && (ready = colors_terminal_is_ready())) {
+ if (mode != UL_COLORMODE_ALWAYS && !isatty(STDOUT_FILENO))
+ cc->mode = UL_COLORMODE_NEVER;
+ else
+ cc->mode = mode;
+
+ if (cc->mode == UL_COLORMODE_UNDEF
+ && (ready = colors_terminal_is_ready())) {
int rc = colors_read_configuration(cc);
if (rc)
cc->mode = UL_COLORMODE_DEFAULT;
@@ -755,6 +757,14 @@ int colors_wanted(void)
}
/*
+ * Returns mode
+ */
+int colors_mode(void)
+{
+ return ul_colors.mode;
+}
+
+/*
* Enable @seq color
*/
void color_fenable(const char *seq, FILE *f)
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index d1d0c434d..b12a9cb60 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -284,7 +284,11 @@ static struct fdisk_parttype gpt_parttypes[] =
DEF_GUID("CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1", N_("QNX6 file system")),
/* Plan 9 */
- DEF_GUID("C91818F9-8025-47AF-89D2-F030D7000C2C", N_("Plan 9 partition"))
+ DEF_GUID("C91818F9-8025-47AF-89D2-F030D7000C2C", N_("Plan 9 partition")),
+
+ /* HiFive Unleased bootloaders */
+ DEF_GUID("5B193300-FC78-40CD-8002-E86C45580B47", N_("HiFive Unleashed FSBL")),
+ DEF_GUID("2E54B353-1271-4842-806F-E436D6AF6985", N_("HiFive Unleashed BBL")),
};
#define alignment_required(_x) ((_x)->grain != (_x)->sector_size)
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 4dff491fb..bd643f3b4 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -550,9 +550,21 @@ int main(int argc, char **argv)
headers_init(&ctl);
- if (!colors_init(ctl.colormode, "cal")) {
- ctl.req.day = 0;
- ctl.weektype &= ~WEEK_NUM_MASK;
+ if (colors_init(ctl.colormode, "cal") == 0) {
+ /*
+ * If standout mode available (Senter and Sexit are set) and
+ * user or terminal-colors.d do not disable colors than
+ * ignore colors_init().
+ */
+ if (*Senter && *Sexit && colors_mode() != UL_COLORMODE_NEVER) {
+ /* let use standout mode */
+ ;
+ } else {
+ /* disable */
+ Senter = Sexit = '\0';
+ ctl.req.day = 0;
+ ctl.weektype &= ~WEEK_NUM_MASK;
+ }
}
if (yflag || Yflag) {
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index 73d816c30..379392b9b 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1164,12 +1164,12 @@ or
Do not use the lazytime feature.
.TP
.B suid
-Allow set-user-ID or set-group-ID bits to take
-effect.
+Honor set-user-ID and set-group-ID bits or file capabilities when
+executing programs from this filesystem.
.TP
.B nosuid
-Do not allow set-user-ID or set-group-ID bits to take
-effect.
+Do not honor set-user-ID and set-group-ID bits or file capabilities when
+executing programs from this filesystem.
.TP
.B silent
Turn on the silent flag.