]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
gssd_proc: use pollsize, not FD_ALLOC_BLOCK, in get_poll_index()
authorNeilBrown <neilb@suse.de>
Wed, 28 Nov 2012 19:32:00 +0000 (14:32 -0500)
committerSteve Dickson <steved@redhat.com>
Wed, 28 Nov 2012 19:48:01 +0000 (14:48 -0500)
get_poll_index wants to walk the entire "pollarray", but uses
the constant FD_ALLOC_BLOCK, rather than the variable
pollsize (which has the same value).  If we want to make the
size of the array variable, it is best not to use the constant.

As pollsize is 'unsigned long', 'i' should be too.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/gssd/gssd_proc.c

index 2fba7de00039f7e264a38c6ac2d2a2ed4cfcf84d..ba118d7fda62959a42446c8110a373e55882aaab 100644 (file)
@@ -387,10 +387,10 @@ process_clnt_dir_files(struct clnt_info * clp)
 static int
 get_poll_index(int *ind)
 {
-       int i;
+       unsigned int i;
 
        *ind = -1;
-       for (i=0; i<FD_ALLOC_BLOCK; i++) {
+       for (i=0; i<pollsize; i++) {
                if (pollarray[i].events == 0) {
                        *ind = i;
                        break;