* [PATCH] tools lib subcmd: do not alias select() params
@ 2018-01-01 10:56 Sergey Senozhatsky
0 siblings, 0 replies; only message in thread
From: Sergey Senozhatsky @ 2018-01-01 10:56 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: Andrew Morton, linux-kernel, Sergey Senozhatsky
Use a separate fd set for select()-s exception fds param to
fix the following gcc warning:
pager.c:36:12: error: passing argument 2 to restrict-qualified
parameter aliases with argument 4 [-Werror=restrict]
select(1, &in, NULL, &in, NULL);
^~~ ~~~
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
| 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c
index 5ba754d17952..9997a8805a82 100644
--- a/tools/lib/subcmd/pager.c
+++ b/tools/lib/subcmd/pager.c
@@ -30,10 +30,13 @@ static void pager_preexec(void)
* have real input
*/
fd_set in;
+ fd_set exception;
FD_ZERO(&in);
+ FD_ZERO(&exception);
FD_SET(0, &in);
- select(1, &in, NULL, &in, NULL);
+ FD_SET(0, &exception);
+ select(1, &in, NULL, &exception, NULL);
setenv("LESS", "FRSX", 0);
}
--
2.15.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-01 10:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01 10:56 [PATCH] tools lib subcmd: do not alias select() params Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®