Skip to content

Commit

Permalink
tools/lib/subcmd/pager.c: do not alias select() params
Browse files Browse the repository at this point in the history
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);
              ^~~        ~~~

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Sergey Senozhatsky <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sergey-senozhatsky authored and torvalds committed Feb 7, 2018
1 parent dfbc3c6 commit ad343a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/lib/subcmd/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ad343a9

Please sign in to comment.