OpenBSD CVS

CVS log for src/sbin/dmesg/dmesg.c


[BACK] Up to [local] / src / sbin / dmesg

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.33 / (download) - annotate - [select for diffs], Sun Dec 4 23:50:46 2022 UTC (17 months, 3 weeks ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.32: +1 -2 lines
Diff to previous 1.32 (colored)

userspace: remove vestigial '?' cases from top-level getopt(3) loops

getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Aug 3 00:23:14 2022 UTC (21 months, 4 weeks ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.31: +4 -1 lines
Diff to previous 1.31 (colored)

dmesg(8): don't accept positional arguments

dmesg(8) doesn't use any positional arguments.  If we see any, it's a
usage error.

ok florian@, "Sure" deraadt@ millert@

Revision 1.31 / (download) - annotate - [select for diffs], Tue Dec 24 13:20:44 2019 UTC (4 years, 5 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored)

dmesg(8) allocated a bit too much memory due to padding of struct
msgbuf.  Use the same size algorithm in kernel and userland.
OK cheloha@ guenther@ deraadt@

Revision 1.30 / (download) - annotate - [select for diffs], Tue May 15 15:15:50 2018 UTC (6 years ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

drop unused <time.h>

ok kn@ mpi@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Sep 1 07:31:45 2017 UTC (6 years, 9 months ago) by tom
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.28: +5 -3 lines
Diff to previous 1.28 (colored)

free() the memory we allocate in dmesg.c.  While this memory would be
released on process exit, otto@ points out that various checks happen
on free(), so this helps detect memory management errors.

Based on a diff from Nan Xiao - thanks.

ok otto@

Revision 1.28 / (download) - annotate - [select for diffs], Sat Aug 26 08:53:20 2017 UTC (6 years, 9 months ago) by tom
Branch: MAIN
Changes since 1.27: +5 -3 lines
Diff to previous 1.27 (colored)

Be more precise in the messages given by err() after calling sysctl()
in dmesg.c.

Based on a diff from xiao_nan (at) dsi (dot) a-star (dot) edu (dot) sg -
thanks.

ok otto@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:06 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.26 / (download) - annotate - [select for diffs], Sun Oct 4 18:49:30 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +7 -1 lines
Diff to previous 1.25 (colored)

dmesg has two modes.  The normal sysctl mode, and the -M/-N kvm searcher.
In both cases once the relevant setup is done, it can drop to tame "stdio".

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:57 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jan 13 10:07:58 2015 UTC (9 years, 4 months ago) by mpf
Branch: MAIN
Changes since 1.23: +9 -5 lines
Diff to previous 1.23 (colored)

Add dmesg -s support, to view the output of rc(8) system startup messages.
Help and feedback by Theo and Miod.
OK deraadt@, manpage-ok jmc@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 22 20:43:12 2014 UTC (10 years, 1 month ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.22: +2 -3 lines
Diff to previous 1.22 (colored)

malloc/memset -> calloc. from peter malone

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jul 2 22:02:06 2010 UTC (13 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

some data structures were still present when NOKVM was defined

Revision 1.21 / (download) - annotate - [select for diffs], Fri Oct 17 18:49:50 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

init bufdata to NULL for when compiled without KVM support

Revision 1.20 / (download) - annotate - [select for diffs], Sun Dec 24 00:47:27 2006 UTC (17 years, 5 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.19: +1 -5 lines
Diff to previous 1.19 (colored)

zap incorrect comment

Revision 1.19 / (download) - annotate - [select for diffs], Thu Apr 28 11:10:03 2005 UTC (19 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.18: +8 -6 lines
Diff to previous 1.18 (colored)

tiny doses of KNF, inspired by a diff for sth else from Brian <bwaichu@yahoo.com>

Revision 1.18 / (download) - annotate - [select for diffs], Thu Apr 14 10:23:37 2005 UTC (19 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.17: +1 -15 lines
Diff to previous 1.17 (colored)

shave off a few bytes, alpha floppies fit again now

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jun 2 20:06:14 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.16: +3 -7 lines
Diff to previous 1.16 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jul 3 22:32:32 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.15: +4 -6 lines
Diff to previous 1.15 (colored)

ansi

Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:33 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 5 07:39:16 2001 UTC (22 years, 7 months ago) by mpech
Branch: MAIN
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

kill more registers;

millert@ ok

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jul 7 18:26:11 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

major -Wall cleanup, almost complete

Revision 1.12 / (download) - annotate - [select for diffs], Sat Jul 7 00:11:26 2001 UTC (22 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

#include <string.h> for memset() proto

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jun 22 23:24:25 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (colored)

smaller dmesg

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jun 22 22:06:23 2001 UTC (22 years, 11 months ago) by mickey
Branch: MAIN
Changes since 1.9: +57 -35 lines
Diff to previous 1.9 (colored)

use sysctl to retreive msgbuf out of live system, keep the kvm iface, remove sgid

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jun 4 14:59:47 2001 UTC (23 years ago) by mickey
Branch: MAIN
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

return from main() don't exit

Revision 1.8 / (download) - annotate - [select for diffs], Tue Feb 22 19:27:38 2000 UTC (24 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.7: +17 -12 lines
Diff to previous 1.7 (colored)

enlarge msgbuf, somewhat line netbsd did

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 8 22:14:37 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.6: +6 -2 lines
Diff to previous 1.6 (colored)

whack kmem gid after kvm_openfiles()

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 5 18:45:17 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +8 -4 lines
Diff to previous 1.5 (colored)

split KREAD() calls

Revision 1.5 / (download) - annotate - [select for diffs], Sat Mar 29 20:28:20 1997 UTC (27 years, 2 months ago) by tholo
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.4: +7 -7 lines
Diff to previous 1.4 (colored)

Avoid infinite loops; from NetBSD PR 3285

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jan 15 23:41:10 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

getopt(3) returns -1 when out of args, not EOF, whee!

Revision 1.3 / (download) - annotate - [select for diffs], Sun Dec 22 03:00:49 1996 UTC (27 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +5 -3 lines
Diff to previous 1.2 (colored)

Deal with _POSIX_SAVED_IDS when relinquishing privileges

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 23 14:30:08 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

update rcsid

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:43:28 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:43:28 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.