From 9985a5ca73f93bc4bec0f7f4dac660a3df8f644c Mon Sep 17 00:00:00 2001 From: yamt Date: Wed, 23 Jul 2003 13:41:00 +0000 Subject: [PATCH] use sizeof() instead of hardcoding the size of the array. --- sys/nfs/nfs_socket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 34e73decbc87..b313c4b5a0c8 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -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 -__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; }