summaryrefslogtreecommitdiff
path: root/fs/proc/kmsg.c
diff options
context:
space:
mode:
authorKees Cook <kees.cook@canonical.com>2010-02-03 15:37:13 -0800
committerJames Morris <jmorris@namei.org>2010-02-04 14:20:41 +1100
commitd78ca3cd733d8a2c3dcd88471beb1a15d973eed8 (patch)
treea27ccf86f5f7df3cc987d0203ed0bff2db46db57 /fs/proc/kmsg.c
parent002345925e6c45861f60db6f4fc6236713fd8847 (diff)
downloadlinux-3.10-d78ca3cd733d8a2c3dcd88471beb1a15d973eed8.tar.gz
linux-3.10-d78ca3cd733d8a2c3dcd88471beb1a15d973eed8.tar.bz2
linux-3.10-d78ca3cd733d8a2c3dcd88471beb1a15d973eed8.zip
syslog: use defined constants instead of raw numbers
Right now the syslog "type" action are just raw numbers which makes the source difficult to follow. This patch replaces the raw numbers with defined constants for some level of sanity. Signed-off-by: Kees Cook <kees.cook@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/proc/kmsg.c')
-rw-r--r--fs/proc/kmsg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index 6a3d843a108..cfe90a48a6e 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -21,12 +21,12 @@ extern wait_queue_head_t log_wait;
static int kmsg_open(struct inode * inode, struct file * file)
{
- return do_syslog(1, NULL, 0, SYSLOG_FROM_FILE);
+ return do_syslog(SYSLOG_ACTION_OPEN, NULL, 0, SYSLOG_FROM_FILE);
}
static int kmsg_release(struct inode * inode, struct file * file)
{
- (void) do_syslog(0, NULL, 0, SYSLOG_FROM_FILE);
+ (void) do_syslog(SYSLOG_ACTION_CLOSE, NULL, 0, SYSLOG_FROM_FILE);
return 0;
}
@@ -34,15 +34,15 @@ static ssize_t kmsg_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
if ((file->f_flags & O_NONBLOCK) &&
- !do_syslog(9, NULL, 0, SYSLOG_FROM_FILE))
+ !do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_FILE))
return -EAGAIN;
- return do_syslog(2, buf, count, SYSLOG_FROM_FILE);
+ return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_FILE);
}
static unsigned int kmsg_poll(struct file *file, poll_table *wait)
{
poll_wait(file, &log_wait, wait);
- if (do_syslog(9, NULL, 0, SYSLOG_FROM_FILE))
+ if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_FILE))
return POLLIN | POLLRDNORM;
return 0;
}