summaryrefslogtreecommitdiff
path: root/src/shared/ptyfwd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-05 18:31:32 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-05 18:33:24 +0100
commitd147457cc907ace9bfde8fc08a27616b864973d1 (patch)
treeadc3f0a21199cd2968966d725cfce5ac791ccfd3 /src/shared/ptyfwd.c
parente22e69a31edd3089514436174f97d4d8d96ed194 (diff)
downloadsystemd-d147457cc907ace9bfde8fc08a27616b864973d1.tar.gz
run: run pty forwarder at higher event priority than the bus
We want any tty I/O to happen before we look at service messages, hence let's set priorities on them, and give tty I/O a higher priority.
Diffstat (limited to 'src/shared/ptyfwd.c')
-rw-r--r--src/shared/ptyfwd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index 3cc2e187cc..94a4dd513f 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -573,3 +573,26 @@ bool pty_forward_drain(PTYForward *f) {
f->drain = true;
return drained(f);
}
+
+int pty_forward_set_priority(PTYForward *f, int64_t priority) {
+ int r;
+ assert(f);
+
+ r = sd_event_source_set_priority(f->stdin_event_source, priority);
+ if (r < 0)
+ return r;
+
+ r = sd_event_source_set_priority(f->stdout_event_source, priority);
+ if (r < 0)
+ return r;
+
+ r = sd_event_source_set_priority(f->master_event_source, priority);
+ if (r < 0)
+ return r;
+
+ r = sd_event_source_set_priority(f->sigwinch_event_source, priority);
+ if (r < 0)
+ return r;
+
+ return 0;
+}