diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1995-11-14 08:00:00 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1995-11-14 08:00:00 +0000 |
commit | e7c2a72e2680827d6a733931273a93461c0d8d1b (patch) | |
tree | c9abeda78ef7504062bb2e816bcf3e3c9d680112 /kernel/printk.c | |
parent | ec6044459060a8c9ce7f64405c465d141898548c (diff) |
Import of Linux/MIPS 1.3.0
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index d92269b30..8b518f6cb 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -19,6 +19,7 @@ #include <linux/errno.h> #include <linux/sched.h> #include <linux/kernel.h> +#include <linux/mm.h> #define LOG_BUF_LEN 4096 @@ -129,7 +130,7 @@ asmlinkage int sys_syslog(int type, char * buf, int len) console_loglevel = DEFAULT_CONSOLE_LOGLEVEL; return 0; case 8: - if (len < 0 || len > 8) + if (len < 1 || len > 8) return -EINVAL; console_loglevel = len; return 0; @@ -173,8 +174,10 @@ asmlinkage int printk(const char *fmt, ...) log_buf[(log_start+log_size) & (LOG_BUF_LEN-1)] = *p; if (log_size < LOG_BUF_LEN) log_size++; - else + else { log_start++; + log_start &= LOG_BUF_LEN-1; + } logged_chars++; if (*p == '\n') break; |