diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-12-23 17:28:17 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-12-24 00:29:40 +0100 |
commit | 11dc5d2b649afaf9f4470ad97929ebe844604f44 (patch) | |
tree | a359ffa2dd25d2d115583ca6eda2773925216f05 | |
parent | 23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0 (diff) |
util: when determining controlling tty of a process properly handle processes without
-rw-r--r-- | src/shared/util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index d01c2061b4..59d8544d05 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -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; } |