use sizeof() instead of hardcoding the size of the array.

This commit is contained in:
yamt 2003-07-23 13:41:00 +00:00
parent f4fc192872
commit 9985a5ca73

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_socket.c,v 1.92 2003/06/29 22:32:17 fvdl Exp $ */
/* $NetBSD: nfs_socket.c,v 1.93 2003/07/23 13:41:00 yamt Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1995
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.92 2003/06/29 22:32:17 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.93 2003/07/23 13:41:00 yamt Exp $");
#include "fs_nfs.h"
#include "opt_nfs.h"
@ -1135,7 +1135,8 @@ tryagain:
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nqnfstry", 0);
trylater_delay *= nfs_backoff[trylater_cnt];
if (trylater_cnt < 7)
if (trylater_cnt + 1 <
sizeof(nfs_backoff) / sizeof(nfs_backoff[0])
trylater_cnt++;
goto tryagain;
}