do not fail build if MAXSYMLINKS isn't defined
[oweals/busybox.git] / init / mesg.c
index 8489e621c1f36b31223664f17cc9ec5d54519b1a..45c13b8e030e5fa3fe6446830ad6262b17fe8ac3 100644 (file)
@@ -60,17 +60,17 @@ int mesg_main(int argc UNUSED_PARAM, char **argv)
                bb_show_usage();
        }
 
-       if (!isatty(STDERR_FILENO))
+       if (!isatty(STDIN_FILENO))
                bb_error_msg_and_die("not a tty");
 
-       xfstat(STDERR_FILENO, &sb, "stderr");
+       xfstat(STDIN_FILENO, &sb, "stderr");
        if (c == 0) {
                puts((sb.st_mode & (S_IWGRP|S_IWOTH)) ? "is y" : "is n");
                return EXIT_SUCCESS;
        }
        m = (c == 'y') ? sb.st_mode | S_IWGRP_OR_S_IWOTH
                       : sb.st_mode & ~(S_IWGRP|S_IWOTH);
-       if (fchmod(STDERR_FILENO, m) != 0)
+       if (fchmod(STDIN_FILENO, m) != 0)
                bb_perror_nomsg_and_die();
        return EXIT_SUCCESS;
 }