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 HDR = util.h arg.h ubase.h
LIB = \ LIB = \
$(OS)/dmesg.o \
$(OS)/grabmntinfo.o \ $(OS)/grabmntinfo.o \
$(OS)/syslog.o \
$(OS)/umount.o \ $(OS)/umount.o \
util/eprintf.o \ util/eprintf.o \
util/estrtol.o util/estrtol.o

12
dmesg.c
View File

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

View File

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

View File

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

View File

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