treewide: Use stdio file descriptor constants

The numeric constants for stdout and stderr are used in a couple of
places, replace them with the friendlier constants.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
This commit is contained in:
Bjorn Andersson committed 2026-07-05 19:32:56 +00:00
1 parent e6dcfc57df
commit 9785de94e9
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -834,9 +834,9 @@ int main(int argc, char **argv)
const char blue[] = "\033[94m";
const char reset[] = "\033[0m";
write(2, blue, sizeof(blue) - 1);
write(2, buf, n);
write(2, reset, sizeof(reset) - 1);
write(STDERR_FILENO, blue, sizeof(blue) - 1);
write(STDERR_FILENO, buf, n);
write(STDERR_FILENO, reset, sizeof(reset) - 1);
bump_inactivity_timer = true;
}
+1 -1
View File
@@ -29,7 +29,7 @@ static int external_helper(struct external *ext, const char *command, bool on)
switch (pid) {
case 0:
/* Do not clobber stdout with program messages or cdba will become confused */
dup2(2, 1);
dup2(STDERR_FILENO, STDOUT_FILENO);
return execlp(ext->path, ext->path, ext->board, command, on ? "on": "off", NULL);
case -1:
return -1;