Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Adjust nlinesw correctly.



details:   https://anonhg.NetBSD.org/src/rev/4debf4aa4d32
branches:  trunk
changeset: 499256:4debf4aa4d32
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Nov 15 01:42:53 2000 +0000

description:
Adjust nlinesw correctly.

diffstat:

 sys/kern/tty_conf.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 09d93fbcabc7 -r 4debf4aa4d32 sys/kern/tty_conf.c
--- a/sys/kern/tty_conf.c       Wed Nov 15 01:41:22 2000 +0000
+++ b/sys/kern/tty_conf.c       Wed Nov 15 01:42:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_conf.c,v 1.29 2000/11/15 01:41:22 enami Exp $      */
+/*     $NetBSD: tty_conf.c,v 1.30 2000/11/15 01:42:53 enami Exp $      */
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -190,7 +190,9 @@
                for (no = slinesw; no-- > 0;)
                        if (linesw[no] == NULL)
                                break;
-               /* if no == -1 we should realloc linesw. */
+               /* if no == -1 we should realloc linesw, but for now... */
+               if (no == -1)
+                       return (-1);
        }
 
        /* Need a specific slot */
@@ -228,9 +230,9 @@
                        
                        if (nlinesw == i + 1) {
                                /* Need to fix up array sizing */
-                               while (i && (linesw[i] != NULL))
-                                       i--;
-                               nlinesw = i + i;
+                               while (i-- > 0 && linesw[i] == NULL)
+                                       continue;
+                               nlinesw = i + 1;
                        }
                        return (disc);
                }



Home | Main Index | Thread Index | Old Index