summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2006-12-06 20:37:42 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:38 -0800
commitc36264dfb2d6fa6383082de0a1bba8e12b477da1 (patch)
tree25efc8365544d12974f0633ad46f619bfbf087e1
parent44ddc4f5673a62c9ecdbb7b502fe7b8206b0f945 (diff)
downloadop-kernel-dev-c36264dfb2d6fa6383082de0a1bba8e12b477da1.zip
op-kernel-dev-c36264dfb2d6fa6383082de0a1bba8e12b477da1.tar.gz
[PATCH] remove the syslog interface when printk is disabled
Attempts to read() from the non-existent dmesg buffer will return zero and userspace tends to get stuck in a busyloop. So just remove /dev/kmsg altogether if CONFIG_PRINTK=n. Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/proc/Makefile3
-rw-r--r--fs/proc/proc_misc.c2
-rw-r--r--kernel/printk.c7
3 files changed, 5 insertions, 7 deletions
diff --git a/fs/proc/Makefile b/fs/proc/Makefile
index 7431d7b..f6c7762 100644
--- a/fs/proc/Makefile
+++ b/fs/proc/Makefile
@@ -8,8 +8,9 @@ proc-y := nommu.o task_nommu.o
proc-$(CONFIG_MMU) := mmu.o task_mmu.o
proc-y += inode.o root.o base.o generic.o array.o \
- kmsg.o proc_tty.o proc_misc.o
+ proc_tty.o proc_misc.o
proc-$(CONFIG_PROC_KCORE) += kcore.o
proc-$(CONFIG_PROC_VMCORE) += vmcore.o
proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o
+proc-$(CONFIG_PRINTK) += kmsg.o
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 93c43b6..51815ce 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -696,9 +696,11 @@ void __init proc_misc_init(void)
proc_symlink("mounts", NULL, "self/mounts");
/* And now for trickier ones */
+#ifdef CONFIG_PRINTK
entry = create_proc_entry("kmsg", S_IRUSR, &proc_root);
if (entry)
entry->proc_fops = &proc_kmsg_operations;
+#endif
create_seq_entry("devices", 0, &proc_devinfo_operations);
create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
#ifdef CONFIG_BLOCK
diff --git a/kernel/printk.c b/kernel/printk.c
index 6642655..ba59c2a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -631,12 +631,7 @@ EXPORT_SYMBOL(vprintk);
asmlinkage long sys_syslog(int type, char __user *buf, int len)
{
- return 0;
-}
-
-int do_syslog(int type, char __user *buf, int len)
-{
- return 0;
+ return -ENOSYS;
}
static void call_console_drivers(unsigned long start, unsigned long end)
OpenPOWER on IntegriCloud