1
0
mirror of git://git.suckless.org/ubase synced 2024-12-22 06:40:38 +00:00

Support -C for dmesg(1)

This commit is contained in:
sin 2013-08-14 14:34:57 +01:00
parent f6cf690aa2
commit 76614ae86b

View File

@ -11,13 +11,14 @@ static int dmesg_show(int fd, const void *buf, size_t n);
enum {
SYSLOG_ACTION_READ_ALL = 3,
SYSLOG_ACTION_CLEAR = 5,
SYSLOG_ACTION_SIZE_BUFFER = 10
};
static void
usage(void)
{
eprintf("usage: %s\n", argv0);
eprintf("usage: [-C] %s\n", argv0);
}
int
@ -27,6 +28,10 @@ main(int argc, char *argv[])
char *buf;
ARGBEGIN {
case 'C':
if (klogctl(SYSLOG_ACTION_CLEAR, NULL, 0) < 0)
eprintf("klogctl:");
return 0;
default:
usage();
} ARGEND;