Commit 1818b840 authored by Benjamin Berg's avatar Benjamin Berg Committed by Richard Weinberger

um: Do not use printk in SIGWINCH helper thread

The thread is running outside of the UML kernel scope and is a helper.
As such, printk cannot work and os_info must be used instead.
Signed-off-by: default avatarBenjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 236f9fe3
...@@ -153,8 +153,8 @@ static int winch_thread(void *arg) ...@@ -153,8 +153,8 @@ static int winch_thread(void *arg)
pipe_fd = data->pipe_fd; pipe_fd = data->pipe_fd;
count = write(pipe_fd, &c, sizeof(c)); count = write(pipe_fd, &c, sizeof(c));
if (count != sizeof(c)) if (count != sizeof(c))
printk(UM_KERN_ERR "winch_thread : failed to write " os_info("winch_thread : failed to write synchronization byte, err = %d\n",
"synchronization byte, err = %d\n", -count); -count);
/* /*
* We are not using SIG_IGN on purpose, so don't fix it as I thought to * We are not using SIG_IGN on purpose, so don't fix it as I thought to
...@@ -166,28 +166,28 @@ static int winch_thread(void *arg) ...@@ -166,28 +166,28 @@ static int winch_thread(void *arg)
sigfillset(&sigs); sigfillset(&sigs);
/* Block all signals possible. */ /* Block all signals possible. */
if (sigprocmask(SIG_SETMASK, &sigs, NULL) < 0) { if (sigprocmask(SIG_SETMASK, &sigs, NULL) < 0) {
printk(UM_KERN_ERR "winch_thread : sigprocmask failed, " os_info("winch_thread : sigprocmask failed, errno = %d\n",
"errno = %d\n", errno); errno);
exit(1); exit(1);
} }
/* In sigsuspend(), block anything else than SIGWINCH. */ /* In sigsuspend(), block anything else than SIGWINCH. */
sigdelset(&sigs, SIGWINCH); sigdelset(&sigs, SIGWINCH);
if (setsid() < 0) { if (setsid() < 0) {
printk(UM_KERN_ERR "winch_thread : setsid failed, errno = %d\n", os_info("winch_thread : setsid failed, errno = %d\n",
errno); errno);
exit(1); exit(1);
} }
if (ioctl(pty_fd, TIOCSCTTY, 0) < 0) { if (ioctl(pty_fd, TIOCSCTTY, 0) < 0) {
printk(UM_KERN_ERR "winch_thread : TIOCSCTTY failed on " os_info("winch_thread : TIOCSCTTY failed on "
"fd %d err = %d\n", pty_fd, errno); "fd %d err = %d\n", pty_fd, errno);
exit(1); exit(1);
} }
if (tcsetpgrp(pty_fd, os_getpid()) < 0) { if (tcsetpgrp(pty_fd, os_getpid()) < 0) {
printk(UM_KERN_ERR "winch_thread : tcsetpgrp failed on " os_info("winch_thread : tcsetpgrp failed on fd %d err = %d\n",
"fd %d err = %d\n", pty_fd, errno); pty_fd, errno);
exit(1); exit(1);
} }
...@@ -199,8 +199,8 @@ static int winch_thread(void *arg) ...@@ -199,8 +199,8 @@ static int winch_thread(void *arg)
*/ */
count = read(pipe_fd, &c, sizeof(c)); count = read(pipe_fd, &c, sizeof(c));
if (count != sizeof(c)) if (count != sizeof(c))
printk(UM_KERN_ERR "winch_thread : failed to read " os_info("winch_thread : failed to read synchronization byte, err = %d\n",
"synchronization byte, err = %d\n", errno); errno);
while(1) { while(1) {
/* /*
...@@ -211,8 +211,8 @@ static int winch_thread(void *arg) ...@@ -211,8 +211,8 @@ static int winch_thread(void *arg)
count = write(pipe_fd, &c, sizeof(c)); count = write(pipe_fd, &c, sizeof(c));
if (count != sizeof(c)) if (count != sizeof(c))
printk(UM_KERN_ERR "winch_thread : write failed, " os_info("winch_thread : write failed, err = %d\n",
"err = %d\n", errno); errno);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment