Rename syslog_{size,read,show} to dmesg_{size,read,show}

This commit is contained in:
sin 2013-08-12 10:17:36 +01:00
parent f4ad2b276c
commit eaa5285d68
5 changed files with 17 additions and 17 deletions

View File

@ -5,8 +5,8 @@ include config.mk
HDR = util.h arg.h ubase.h
LIB = \
$(OS)/dmesg.o \
$(OS)/grabmntinfo.o \
$(OS)/syslog.o \
$(OS)/umount.o \
util/eprintf.o \
util/estrtol.o

12
dmesg.c
View File

@ -22,18 +22,18 @@ main(int argc, char *argv[])
usage();
} ARGEND;
n = syslog_size();
n = dmesg_size();
if (n < 0)
eprintf("syslog_size:");
eprintf("dmesg_size:");
buf = malloc(n);
if (!buf)
eprintf("malloc:");
n = syslog_read(buf, n);
n = dmesg_read(buf, n);
if (n < 0)
eprintf("syslog_read:");
n = syslog_show(STDOUT_FILENO, buf, n);
eprintf("dmesg_read:");
n = dmesg_show(STDOUT_FILENO, buf, n);
if (n < 0)
eprintf("syslog_show:");
eprintf("dmesg_show:");
free(buf);
return 0;
}

View File

@ -9,19 +9,19 @@ enum {
};
int
syslog_size(void)
dmesg_size(void)
{
return klogctl(SYSLOG_ACTION_SIZE_BUFFER, NULL, 0);
}
int
syslog_read(void *buf, size_t n)
dmesg_read(void *buf, size_t n)
{
return klogctl(SYSLOG_ACTION_READ_ALL, buf, n);
}
int
syslog_show(int fd, const void *buf, size_t n)
dmesg_show(int fd, const void *buf, size_t n)
{
int last = '\n';
const char *p = buf;

View File

@ -8,7 +8,7 @@
#include <string.h>
int
syslog_size(void)
dmesg_size(void)
{
int mib[2], msgbufsize;
size_t len;
@ -25,7 +25,7 @@ syslog_size(void)
}
int
syslog_read(void *buf, size_t n)
dmesg_read(void *buf, size_t n)
{
int mib[2];
int ret;
@ -41,7 +41,7 @@ syslog_read(void *buf, size_t n)
}
int
syslog_show(int fd, const void *buf, size_t n)
dmesg_show(int fd, const void *buf, size_t n)
{
return write(fd, buf, n);
}

View File

@ -8,10 +8,10 @@ struct mntinfo {
int grabmntinfo(struct mntinfo **minfo);
/* syslog.c */
int syslog_size(void);
int syslog_read(void *buf, size_t n);
int syslog_show(int fd, const void *buf, size_t n);
/* dmesg.c */
int dmesg_size(void);
int dmesg_read(void *buf, size_t n);
int dmesg_show(int fd, const void *buf, size_t n);
/* umount.c */
enum {