diff options
author | John Crispin <blogic@openwrt.org> | 2014-10-06 20:13:28 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-10-06 20:53:55 +0200 |
commit | 5ca0a7069a50c6b588657cf648dc53192f2e7a7f (patch) | |
tree | bf5368f15fbc865919d49f59195edc80d9fcb545 | |
parent | 49522abb5adebeedc25f7eb7e152c308ef04b32d (diff) | |
download | unitd-5ca0a7069a50c6b588657cf648dc53192f2e7a7f.tar unitd-5ca0a7069a50c6b588657cf648dc53192f2e7a7f.zip |
Fix scroll lock blocking procd
On x86, pressing the scrolllock button may effectively prevent procd from rebooting
the system. This happens because procd tries to write to /dev/console, which in that
situation is blocked, effectively blocking procd from rebooting the system.
This patch puts procd's stderr access into non-blocking, which will prevent the
boot from being stuck.
Signed-off-by: Michel Stam <m.stam@fugro.nl>
-rw-r--r-- | initd/early.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/initd/early.c b/initd/early.c index 77ced77..a9f6afb 100644 --- a/initd/early.c +++ b/initd/early.c @@ -72,6 +72,8 @@ early_console(const char *dev) dd != STDOUT_FILENO && dd != STDERR_FILENO) close(dd); + + fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) | O_NONBLOCK); } static void |