summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/util.c3
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;
}