don't update battery backed up clock if system time is wrong from begin
authorkstailey <kstailey@openbsd.org>
Fri, 17 Jan 1997 05:53:37 +0000 (05:53 +0000)
committerkstailey <kstailey@openbsd.org>
Fri, 17 Jan 1997 05:53:37 +0000 (05:53 +0000)
in ddb.

sys/arch/alpha/alpha/machdep.c
sys/arch/amiga/amiga/machdep.c
sys/arch/sparc/sparc/machdep.c

index df76a38..4a31d96 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: machdep.c,v 1.13 1996/12/08 00:20:18 niklas Exp $     */
+/*     $OpenBSD: machdep.c,v 1.14 1997/01/17 05:53:37 kstailey Exp $   */
 /*     $NetBSD: machdep.c,v 1.52 1996/11/06 20:19:19 cgd Exp $ */
 
 /*
@@ -852,9 +852,14 @@ boot(howto /* , bootstr */)
                vfs_shutdown();
                /*
                 * If we've been adjusting the clock, the todr
-                * will be out of synch; adjust it now.
+                * will be out of synch; adjust it now unless
+                * the system was sitting in ddb.
                 */
-               resettodr();
+               if ((howto & RB_TIMEBAD) == 0) {
+                       resettodr();
+               } else {
+                       printf("WARNING: not updating battery clock\n");
+               }
        }
 
        /* Disable interrupts. */
index f998c2b..95619f6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: machdep.c,v 1.16 1997/01/16 09:23:24 niklas Exp $     */
+/*     $OpenBSD: machdep.c,v 1.17 1997/01/17 05:53:39 kstailey Exp $   */
 /*     $NetBSD: machdep.c,v 1.82 1996/12/17 07:32:54 is Exp $  */
 
 /*
@@ -1037,9 +1037,14 @@ bootsync(void)
 
                /*
                 * If we've been adjusting the clock, the todr
-                * will be out of synch; adjust it now.
+                * will be out of synch; adjust it now unless
+                * the system was sitting in ddb.
                 */
-               resettodr();
+               if ((howto & RB_TIMEBAD) == 0) {
+                       resettodr();
+               } else {
+                       printf("WARNING: not updating battery clock\n");
+               }
        }
 }
 
index 1cb6083..6b84e98 100644 (file)
@@ -653,9 +653,14 @@ boot(howto)
 
                /*
                 * If we've been adjusting the clock, the todr
-                * will be out of synch; adjust it now.
+                * will be out of synch; adjust it now unless
+                * the system was sitting in ddb.
                 */
-               resettodr();
+               if ((howto & RB_TIMEBAD) == 0) {
+                       resettodr();
+               } else {
+                       printf("WARNING: not updating battery clock\n");
+               }
        }
        (void) splhigh();               /* ??? */
        if (howto & RB_HALT) {