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:
+5
-3
@@ -572,9 +572,11 @@ 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;
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user