1
0
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:
Lennart Poettering 2012-12-23 17:28:17 +01:00
parent 23406ce58a
commit 11dc5d2b64

View File

@ -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;
}