mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
util: when determining controlling tty of a process properly handle processes without
This commit is contained in:
parent
23406ce58a
commit
11dc5d2b64
@ -2851,6 +2851,9 @@ int get_ctty_devnr(pid_t pid, dev_t *d) {
|
||||
&ttynr) != 1)
|
||||
return -EIO;
|
||||
|
||||
if (major(ttynr) == 0 && minor(ttynr) == 0)
|
||||
return -ENOENT;
|
||||
|
||||
*d = (dev_t) ttynr;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user