[git commit master 1/1] mesg: operate on stdin, not on stderr (compat)

Denys Vlasenko vda.linux at googlemail.com
Sun Mar 27 22:59:16 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=4a2aecb53a193916a40594f7c40eab86fedd8f8e
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 init/mesg.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/init/mesg.c b/init/mesg.c
index 8489e62..45c13b8 100644
--- a/init/mesg.c
+++ b/init/mesg.c
@@ -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;
 }
-- 
1.7.3.4



More information about the busybox-cvs mailing list