chiark / gitweb /
getty-generator: fix stripping /dev/
[elogind.git] / src / getty-generator / getty-generator.c
index 36a9369..aeb6d71 100644 (file)
@@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
                  * the variable name we only support ptys here. */
 
                 r = getenv_for_pid(1, "container_ttys", &container_ttys);
-                if (r >= 0) {
+                if (r > 0) {
                         char *w, *state;
                         size_t l;
 
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
                                         t = tty;
 
                                 /* Then, make sure it's actually a pty */
-                                t = path_startswith(tty, "pts/");
+                                t = path_startswith(t, "pts/");
                                 if (!t)
                                         continue;