Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/boot/boot Don't init the net info more than once.



details:   https://anonhg.NetBSD.org/src/rev/4a681de321a3
branches:  trunk
changeset: 486606:4a681de321a3
user:      ragge <ragge%NetBSD.org@localhost>
date:      Fri May 26 20:16:46 2000 +0000

description:
Don't init the net info more than once.

diffstat:

 sys/arch/vax/boot/boot/netio.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 18de9b9b9625 -r 4a681de321a3 sys/arch/vax/boot/boot/netio.c
--- a/sys/arch/vax/boot/boot/netio.c    Fri May 26 20:15:21 2000 +0000
+++ b/sys/arch/vax/boot/boot/netio.c    Fri May 26 20:16:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netio.c,v 1.5 2000/05/20 13:35:07 ragge Exp $  */
+/*     $NetBSD: netio.c,v 1.6 2000/05/26 20:16:46 ragge Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -103,6 +103,7 @@
 #include "vaxstand.h"
 
 static struct iodesc desc;
+static int inited = 0;
 
 struct iodesc *
 socktodesc(sock)
@@ -114,7 +115,10 @@
 net_devinit(struct open_file *f, struct netif_driver *drv, u_char *eaddr) {
        static struct netif best_if;
        struct iodesc *s;
+       int r;
 
+       if (inited)
+               return 0;
        /* find a free socket */
        s = &desc;
 
@@ -169,7 +173,12 @@
        f->f_devdata = s;
 
        /* Get the NFS file handle (mount). */
-       return nfs_mount(0, rootip, rootpath);
+       r = nfs_mount(0, rootip, rootpath);
+       if (r)
+               return r;
+
+       inited = 1;
+       return 0;
 }
 
 ssize_t



Home | Main Index | Thread Index | Old Index