diff options
author | Ron Yorston <rmy@pobox.com> | 2012-03-22 14:11:12 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-03-22 14:11:12 +0000 |
commit | 67758035a4fe040c6ac69b39d61bcd6bddd7b827 (patch) | |
tree | a4a1db7f54c16d12fabe2626b8f1e235cd694e9e /init/mesg.c | |
parent | 811c449748d5bd0505f8510e5582892f94ac0cda (diff) | |
parent | b83c9704128dd106071184e4b00335a3b8486857 (diff) | |
download | busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.tar.gz busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.tar.bz2 busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.zip |
Merge commit 'b83c9704128dd106071184e4b00335a3b8486857' into merge
Diffstat (limited to 'init/mesg.c')
-rw-r--r-- | init/mesg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/init/mesg.c b/init/mesg.c index 8489e621c..45c13b8e0 100644 --- a/init/mesg.c +++ b/init/mesg.c | |||
@@ -60,17 +60,17 @@ int mesg_main(int argc UNUSED_PARAM, char **argv) | |||
60 | bb_show_usage(); | 60 | bb_show_usage(); |
61 | } | 61 | } |
62 | 62 | ||
63 | if (!isatty(STDERR_FILENO)) | 63 | if (!isatty(STDIN_FILENO)) |
64 | bb_error_msg_and_die("not a tty"); | 64 | bb_error_msg_and_die("not a tty"); |
65 | 65 | ||
66 | xfstat(STDERR_FILENO, &sb, "stderr"); | 66 | xfstat(STDIN_FILENO, &sb, "stderr"); |
67 | if (c == 0) { | 67 | if (c == 0) { |
68 | puts((sb.st_mode & (S_IWGRP|S_IWOTH)) ? "is y" : "is n"); | 68 | puts((sb.st_mode & (S_IWGRP|S_IWOTH)) ? "is y" : "is n"); |
69 | return EXIT_SUCCESS; | 69 | return EXIT_SUCCESS; |
70 | } | 70 | } |
71 | m = (c == 'y') ? sb.st_mode | S_IWGRP_OR_S_IWOTH | 71 | m = (c == 'y') ? sb.st_mode | S_IWGRP_OR_S_IWOTH |
72 | : sb.st_mode & ~(S_IWGRP|S_IWOTH); | 72 | : sb.st_mode & ~(S_IWGRP|S_IWOTH); |
73 | if (fchmod(STDERR_FILENO, m) != 0) | 73 | if (fchmod(STDIN_FILENO, m) != 0) |
74 | bb_perror_nomsg_and_die(); | 74 | bb_perror_nomsg_and_die(); |
75 | return EXIT_SUCCESS; | 75 | return EXIT_SUCCESS; |
76 | } | 76 | } |