Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158140
b: refs/heads/master
c: 1aaad49
h: refs/heads/master
v: v3
  • Loading branch information
Frans Pop authored and Ingo Molnar committed Jul 10, 2009
1 parent 1ea7d5e commit e1dff66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8259cf4342029aad37660e524178c8858f48b0ab
refs/heads/master: 1aaad49e856ce41adc07d8ae0c8ef35fc4483245
11 changes: 10 additions & 1 deletion trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ int console_printk[4] = {
DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */
};

static int saved_console_loglevel = -1;

/*
* Low level drivers may need that to know if they can schedule in
* their unblank() callback or not. So let's export it.
Expand Down Expand Up @@ -378,10 +380,15 @@ int do_syslog(int type, char __user *buf, int len)
logged_chars = 0;
break;
case 6: /* Disable logging to console */
if (saved_console_loglevel == -1)
saved_console_loglevel = console_loglevel;
console_loglevel = minimum_console_loglevel;
break;
case 7: /* Enable logging to console */
console_loglevel = default_console_loglevel;
if (saved_console_loglevel != -1) {
console_loglevel = saved_console_loglevel;
saved_console_loglevel = -1;
}
break;
case 8: /* Set level of messages printed to console */
error = -EINVAL;
Expand All @@ -390,6 +397,8 @@ int do_syslog(int type, char __user *buf, int len)
if (len < minimum_console_loglevel)
len = minimum_console_loglevel;
console_loglevel = len;
/* Implicitly re-enable logging to console */
saved_console_loglevel = -1;
error = 0;
break;
case 9: /* Number of chars in the log buffer */
Expand Down

0 comments on commit e1dff66

Please sign in to comment.