From 91d4a3cffdf983cd0915f4610b4e0a9bd47f31ae Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Feb 2026 14:03:12 +0100 Subject: m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- README | 8 ++++---- adjbacklight.1 | 6 +++--- adjbacklight.c | 30 +++++++++++++++--------------- config.mk | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README b/README index be4a4cd..2e28732 100644 --- a/README +++ b/README @@ -6,8 +6,8 @@ SYNOPSIS DESCRIPTION adjbacklight can be used to fetch or set the backlight - non-interactively. If these feature is not used, it starts - a interactive user interface in the terminal. However, if + non-interactively. If this feature is not used, it starts + an interactive user interface in the terminal. However, if stdin is not a terminal, every line from stdin is parsed as a -s argument. @@ -19,8 +19,8 @@ DESCRIPTION computers and can be used inside X. In fact it seems to work for all machines with backlight, which is not true for xbacklight(1). adjbacklight uses /sys/class/backlight. - adjbacklight as been retrofitted to be convenient for use - inside X on desktop computers, with commands that lets it + adjbacklight has been retrofitted to be convenient for use + inside X on desktop computers, with commands that let it be used non-interactively with hotkeys set up in xbindkeys(1). OPTIONS diff --git a/adjbacklight.1 b/adjbacklight.1 index b505192..81d50ef 100644 --- a/adjbacklight.1 +++ b/adjbacklight.1 @@ -10,7 +10,7 @@ adjbacklight - Convenient method for adjusting the backlight on your portable co .SH DESCRIPTION .B adjbacklight can be used to fetch or set the backlight non-interactively. -If these feature is not used, it starts a interactive user +If this feature is not used, it starts an interactive user interface in the terminal. However, if stdin is not a terminal, every line from stdin is parsed as a .B -s @@ -33,9 +33,9 @@ is not true for uses .IR /sys/class/backlight . .B adjbacklight -as been retrofitted to be convenient for use inside +has been retrofitted to be convenient for use inside .B X -on desktop computers, with commands that lets it be used +on desktop computers, with commands that let it be used non-interactively with hotkeys set up in .BR xbindkeys (1). .SH OPTIONS diff --git a/adjbacklight.c b/adjbacklight.c index 57495d8..ba503d5 100644 --- a/adjbacklight.c +++ b/adjbacklight.c @@ -261,8 +261,8 @@ init_terminal(pid_t *pid, struct termios *saved_stty) int i; printf("\n\n"); - printf("If the program is abnormally aborted the may be some residual\n"); - printf("effects on the terminal. the following commands should reset it:\n"); + printf("If the program is abnormally aborted there may be some residual\n"); + printf("effects on the terminal. The following commands should reset it:\n"); printf("\n"); printf(" stty sane\n"); printf(" printf '\\ec'\n"); @@ -428,17 +428,17 @@ main(int argc, char *argv[]) } done: - if (isinteractive && pid) { - /* Show cursor */ - printf("%s", "\033[?25h"); - fflush(stdout); - - /* `stty icanon echo` */ - if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &saved_stty)) { - fprintf(stderr, "%s: tcsetattr : %s\n", argv0, strerror(errno)); - return 1; - } - } - - return 0; + if (isinteractive && pid) { + /* Show cursor */ + printf("%s", "\033[?25h"); + fflush(stdout); + + /* `stty icanon echo` */ + if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &saved_stty)) { + fprintf(stderr, "%s: tcsetattr : %s\n", argv0, strerror(errno)); + return 1; + } + } + + return 0; } diff --git a/config.mk b/config.mk index 9f9195f..a918d46 100644 --- a/config.mk +++ b/config.mk @@ -3,8 +3,8 @@ MANPREFIX = $(PREFIX)/share/man VIDEO_GROUP = video -CC = cc +CC = c99 CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -CFLAGS = -std=c99 -Wall -O2 +CFLAGS = LDFLAGS = -s -- cgit v1.2.3-70-g09d2