summaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-03 01:22:27 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-03 01:22:27 +0000
commitf9bbe9da79dbc8557c74efeb158b431cd67ace52 (patch)
tree3220d014a35f9d88a48668a1468524e988daebff /kernel/printk.c
parent3d697109c1ff85ef563aec3d5e113ef225ed2792 (diff)
Upgrade to 2.1.73.
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index c67c4d748..91bc771f2 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -109,7 +109,7 @@ __initfunc(void console_setup(char *str, int *ints))
*/
asmlinkage int sys_syslog(int type, char * buf, int len)
{
- unsigned long i, j, count;
+ unsigned long i, j, count, flags;
int do_clear = 0;
char c;
int error = -EPERM;
@@ -170,12 +170,19 @@ asmlinkage int sys_syslog(int type, char * buf, int len)
error = verify_area(VERIFY_WRITE,buf,len);
if (error)
goto out;
+ /*
+ * The logged_chars, log_start, and log_size values may
+ * change from an interrupt, so we disable interrupts.
+ */
+ __save_flags(flags);
+ __cli();
count = len;
if (count > LOG_BUF_LEN)
count = LOG_BUF_LEN;
if (count > logged_chars)
count = logged_chars;
j = log_start + log_size - count;
+ __restore_flags(flags);
for (i = 0; i < count; i++) {
c = *((char *) log_buf+(j++ & (LOG_BUF_LEN-1)));
__put_user(c, buf++);