]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pager: fix compiler warning [-Wrestrict]
authorKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 07:41:46 +0000 (09:41 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 07:41:46 +0000 (09:41 +0200)
lib/pager.c: In function â€˜pager_preexec’:
lib/pager.c:148:12: warning: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/pager.c

index 9740c711ea97ddc84aa0a3fa1f3a45d9fa7f4dfb..b3cf6ee79bfcded1abd7d6d986ee9c08698898c6 100644 (file)
@@ -141,11 +141,13 @@ static void pager_preexec(void)
         * Work around bug in "less" by not starting it until we
         * have real input
         */
-       fd_set in;
+       fd_set in, ex;
 
        FD_ZERO(&in);
        FD_SET(STDIN_FILENO, &in);
-       select(1, &in, NULL, &in, NULL);
+       ex = in;
+
+       select(STDIN_FILENO + 1, &in, NULL, &ex, NULL);
 
        if (setenv("LESS", "FRSX", 0) != 0)
                warn(_("failed to set the %s environment variable"), "LESS");