Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/mount_nfs Make it possible to set the retry timeout as ...



details:   https://anonhg.NetBSD.org/src/rev/fa7e301dad5a
branches:  trunk
changeset: 756560:fa7e301dad5a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jul 23 19:25:23 2010 +0000

description:
Make it possible to set the retry timeout as a compile-time define.
This is useful for automated environments where everything (rpcbind,
mountd, nfsd and the client) is started in parallel in a split
second and there is a small chance we will race in there before
everything has been communicated to rpcbind.

diffstat:

 sbin/mount_nfs/getnfsargs.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 1151a51a37b6 -r fa7e301dad5a sbin/mount_nfs/getnfsargs.c
--- a/sbin/mount_nfs/getnfsargs.c       Fri Jul 23 19:14:14 2010 +0000
+++ b/sbin/mount_nfs/getnfsargs.c       Fri Jul 23 19:25:23 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnfsargs.c,v 1.13 2009/11/30 17:17:55 pooka Exp $    */
+/*     $NetBSD: getnfsargs.c,v 1.14 2010/07/23 19:25:23 pooka Exp $    */
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_nfs.c        8.11 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: getnfsargs.c,v 1.13 2009/11/30 17:17:55 pooka Exp $");
+__RCSID("$NetBSD: getnfsargs.c,v 1.14 2010/07/23 19:25:23 pooka Exp $");
 #endif
 #endif /* not lint */
 
@@ -92,6 +92,10 @@
 static int     xdr_dir(XDR *, char *);
 static int     xdr_fh(XDR *, struct nfhret *);
 
+#ifndef MOUNTNFS_RETRYRPC
+#define MOUNTNFS_RETRYRPC 60
+#endif
+
 int
 getnfsargs(char *spec, struct nfs_args *nfsargsp)
 {
@@ -287,7 +291,7 @@
                                (void) chdir("/");
                                opflags |= ISBGRND;
                        }
-                       sleep(60);
+                       sleep(MOUNTNFS_RETRYRPC);
                }
        }
        if (nfhret.stat == 0)



Home | Main Index | Thread Index | Old Index