diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-05 18:31:32 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-05 18:33:24 +0100 |
commit | d147457cc907ace9bfde8fc08a27616b864973d1 (patch) | |
tree | adc3f0a21199cd2968966d725cfce5ac791ccfd3 /src/shared/ptyfwd.c | |
parent | e22e69a31edd3089514436174f97d4d8d96ed194 (diff) | |
download | systemd-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.c | 23 |
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; +} |