|
Justin M. Forbes |
15f127 |
From 85721e6bfc5da3c8f7971c4acb1a0ad16fb2c16a Mon Sep 17 00:00:00 2001
|
|
Justin M. Forbes |
15f127 |
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
Justin M. Forbes |
15f127 |
Date: Thu, 1 Feb 2018 13:29:38 +1100
|
|
Justin M. Forbes |
15f127 |
Subject: [PATCH] tools/lib/subcmd/pager.c: do not alias select() params
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
Use a separate fd set for select()-s exception fds param to fix the
|
|
Justin M. Forbes |
15f127 |
following gcc warning:
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
pager.c:36:12: error: passing argument 2 to restrict-qualified
|
|
Justin M. Forbes |
15f127 |
parameter aliases with argument 4 [-Werror=restrict]
|
|
Justin M. Forbes |
15f127 |
select(1, &in, NULL, &in, NULL);
|
|
Justin M. Forbes |
15f127 |
^~~ ~~~
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
Link: http://lkml.kernel.org/r/20180101105626.7168-1-sergey.senozhatsky@gmail.com
|
|
Justin M. Forbes |
15f127 |
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
Justin M. Forbes |
15f127 |
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Justin M. Forbes |
15f127 |
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
|
Justin M. Forbes |
15f127 |
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
|
|
Justin M. Forbes |
15f127 |
---
|
|
Justin M. Forbes |
15f127 |
tools/lib/subcmd/pager.c | 5 ++++-
|
|
Justin M. Forbes |
15f127 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c
|
|
Justin M. Forbes |
15f127 |
index 5ba754d17952..9997a8805a82 100644
|
|
Justin M. Forbes |
15f127 |
--- a/tools/lib/subcmd/pager.c
|
|
Justin M. Forbes |
15f127 |
+++ b/tools/lib/subcmd/pager.c
|
|
Justin M. Forbes |
15f127 |
@@ -30,10 +30,13 @@ static void pager_preexec(void)
|
|
Justin M. Forbes |
15f127 |
* have real input
|
|
Justin M. Forbes |
15f127 |
*/
|
|
Justin M. Forbes |
15f127 |
fd_set in;
|
|
Justin M. Forbes |
15f127 |
+ fd_set exception;
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
FD_ZERO(&in);
|
|
Justin M. Forbes |
15f127 |
+ FD_ZERO(&exception);
|
|
Justin M. Forbes |
15f127 |
FD_SET(0, &in);
|
|
Justin M. Forbes |
15f127 |
- select(1, &in, NULL, &in, NULL);
|
|
Justin M. Forbes |
15f127 |
+ FD_SET(0, &exception);
|
|
Justin M. Forbes |
15f127 |
+ select(1, &in, NULL, &exception, NULL);
|
|
Justin M. Forbes |
15f127 |
|
|
Justin M. Forbes |
15f127 |
setenv("LESS", "FRSX", 0);
|
|
Justin M. Forbes |
15f127 |
}
|
|
Justin M. Forbes |
15f127 |
--
|
|
Justin M. Forbes |
15f127 |
2.14.3
|
|
Justin M. Forbes |
15f127 |
|