diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2025-07-02 21:55:42 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2025-07-02 21:55:42 +0200 |
| commit | bbaa56f7378240fca3db9165dfd02a4504d95ff1 (patch) | |
| tree | 565e7a149385f5a678d3d69ac2e92959b0f4b8f8 /shell | |
| parent | 8c835540efb88f46a66ee28c74f031b74ad07b26 (diff) | |
| download | busybox-w32-bbaa56f7378240fca3db9165dfd02a4504d95ff1.tar.gz busybox-w32-bbaa56f7378240fca3db9165dfd02a4504d95ff1.tar.bz2 busybox-w32-bbaa56f7378240fca3db9165dfd02a4504d95ff1.zip | |
use pollfd[1] array for poll() argument
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/shell_common.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
| 55 | shell_builtin_read(struct builtin_read_params *params) | 55 | shell_builtin_read(struct builtin_read_params *params) |
| 56 | { | 56 | { |
| 57 | struct pollfd pfd[1]; | 57 | struct pollfd pfd[1]; |
| 58 | #define fd (pfd[0].fd) /* -u FD */ | 58 | #define fd (pfd->fd) /* -u FD */ |
| 59 | unsigned err; | 59 | unsigned err; |
| 60 | unsigned end_ms; /* -t TIMEOUT */ | 60 | unsigned end_ms; /* -t TIMEOUT */ |
| 61 | int nchars; /* -n NUM */ | 61 | int nchars; /* -n NUM */ |
| @@ -142,7 +142,7 @@ shell_builtin_read(struct builtin_read_params *params) | |||
| 142 | * bash seems to ignore -p PROMPT for this use case. | 142 | * bash seems to ignore -p PROMPT for this use case. |
| 143 | */ | 143 | */ |
| 144 | int r; | 144 | int r; |
| 145 | pfd[0].events = POLLIN; | 145 | pfd->events = POLLIN; |
| 146 | r = poll(pfd, 1, /*timeout:*/ 0); | 146 | r = poll(pfd, 1, /*timeout:*/ 0); |
| 147 | /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */ | 147 | /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */ |
| 148 | return (const char *)(uintptr_t)(r <= 0); | 148 | return (const char *)(uintptr_t)(r <= 0); |
