ptyfwd: don't set prio if event source that might not exist
We support read-only ptyfwd options, and on those the input event source won't be allocated. Deal with that and don't invoke a function on it that will then instantly fail.
This commit is contained in:
parent
fb2cfa6c13
commit
1ba37106b3
|
@ -572,9 +572,11 @@ int pty_forward_set_priority(PTYForward *f, int64_t priority) {
|
|||
int r;
|
||||
assert(f);
|
||||
|
||||
if (f->stdin_event_source) {
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue