Source-Changes-HG archive

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

[src/trunk]: src/sbin/dmesg Do not declare unused tstamp for SMALL. NFC.



details:   https://anonhg.NetBSD.org/src/rev/7d5805b7d48e
branches:  trunk
changeset: 368804:7d5805b7d48e
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Aug 06 10:19:44 2022 +0000

description:
Do not declare unused tstamp for SMALL. NFC.

diffstat:

 sbin/dmesg/dmesg.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r 5f97e7171f8c -r 7d5805b7d48e sbin/dmesg/dmesg.c
--- a/sbin/dmesg/dmesg.c        Sat Aug 06 10:16:18 2022 +0000
+++ b/sbin/dmesg/dmesg.c        Sat Aug 06 10:19:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $   */
+/*     $NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $   */
 /*-
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)dmesg.c    8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -145,10 +145,11 @@
 {
        struct kern_msgbuf cur;
        int ch, newl, log, i;
-       size_t tstamp, size;
+       size_t size;
        char *p, *bufdata;
        char buf[5];
 #ifndef SMALL
+       size_t tstamp;
        char tbuf[64];
        char *memf, *nlistf;
        struct timespec boottime;
@@ -263,9 +264,10 @@
 #ifndef SMALL
        frac = false;
        postts = false;
+       tstamp = 0;
        scale = 0;
 #endif
-       for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
+       for (newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
            i < cur.msg_bufs; i++, p++) {
 
 #ifndef SMALL
@@ -395,11 +397,9 @@
 #ifndef SMALL
                                if (!tstamp && postts) {
                                        postts = false;
-#else
-                               if (!tstamp) {
-#endif
                                        continue;
                                }
+#endif
                                /*FALLTHROUGH*/
                        default:
 #ifndef SMALL



Home | Main Index | Thread Index | Old Index