From bbaa56f7378240fca3db9165dfd02a4504d95ff1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Jul 2025 21:55:42 +0200 Subject: use pollfd[1] array for poll() argument Signed-off-by: Denys Vlasenko --- shell/shell_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/shell_common.c') diff --git a/shell/shell_common.c b/shell/shell_common.c index 9a03f7265..2baa9d3a8 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -55,7 +55,7 @@ const char* FAST_FUNC shell_builtin_read(struct builtin_read_params *params) { struct pollfd pfd[1]; -#define fd (pfd[0].fd) /* -u FD */ +#define fd (pfd->fd) /* -u FD */ unsigned err; unsigned end_ms; /* -t TIMEOUT */ int nchars; /* -n NUM */ @@ -142,7 +142,7 @@ shell_builtin_read(struct builtin_read_params *params) * bash seems to ignore -p PROMPT for this use case. */ int r; - pfd[0].events = POLLIN; + pfd->events = POLLIN; r = poll(pfd, 1, /*timeout:*/ 0); /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */ return (const char *)(uintptr_t)(r <= 0); -- cgit v1.2.3-55-g6feb