Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

VT_WAITACTIVE: Avoid returning EINTR when not necessary

We should generally prefer to return ERESTARTNOHAND rather than EINTR,
so that processes with unhandled signals that get ignored don't return
EINTR.

This can help with X startup issues:

Fatal server error:
xf86OpenConsole: VT_WAITACTIVE failed: Interrupted system call

although the real fix is having the X server always retry EINTR
regardless (since EINTR does happen for signals that have handlers
installed). Keithp has a patch for that.

Regardless, ERESTARTNOHAND is the correct thing to use.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+2 -2
+2 -2
drivers/char/vt_ioctl.c
··· 1032 1032 1033 1033 /* 1034 1034 * Sleeps until a vt is activated, or the task is interrupted. Returns 1035 - * 0 if activation, -EINTR if interrupted. 1035 + * 0 if activation, -EINTR if interrupted by a signal handler. 1036 1036 */ 1037 1037 int vt_waitactive(int vt) 1038 1038 { ··· 1057 1057 break; 1058 1058 } 1059 1059 release_console_sem(); 1060 - retval = -EINTR; 1060 + retval = -ERESTARTNOHAND; 1061 1061 if (signal_pending(current)) 1062 1062 break; 1063 1063 schedule();