pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / misc / screensavers / vlock / eintr.patch
blob64f43243432480cb2e2308713ba75ba48f80448e
1 In systemd I have seen this error, using it as a service:
3 vlock-start[14567]: vlock-new: could not activate new terminal: Interrupted system call
5 I think this should fix that.
7 Also on github: https://github.com/viric/vlock/commit/781a26087f83c7247601b6f82f784cca9266694e
9 diff --git a/modules/new.c b/modules/new.c
10 index e9b15fb..7aed640 100644
11 --- a/modules/new.c
12 +++ b/modules/new.c
13 @@ -103,9 +103,19 @@ static char *get_console_name(int n)
14 * file descriptor. */
15 static int activate_console(int consfd, int vtno)
17 - int c = ioctl(consfd, VT_ACTIVATE, vtno);
18 + int c;
19 + do {
20 + c = ioctl(consfd, VT_ACTIVATE, vtno);
21 + } while(c != 0 && errno == EINTR);
23 - return c < 0 ? c : ioctl(consfd, VT_WAITACTIVE, vtno);
24 + if (c < 0)
25 + return c;
27 + do {
28 + c = ioctl(consfd, VT_WAITACTIVE, vtno);
29 + } while(c != 0 && errno == EINTR);
31 + return c;
34 struct new_console_context {