[hackers] [ubase] Only work with stderr in mesg || sin
commit 129168715207a4e28cbc276cccdf4c5ff59b2163
Author: sin <sin_AT_2f30.org>
Date: Mon Aug 4 21:02:28 2014 +0100
Only work with stderr in mesg
Previous commit was incomplete (damn git add -p).
diff --git a/mesg.c b/mesg.c
index fb94958..9942133 100644
--- a/mesg.c
+++ b/mesg.c
_AT_@ -29,10 +29,10 @@ main(int argc, char *argv[])
usage();
if (isatty(STDERR_FILENO) == 0)
- eprintf("stdin: not a tty
");
+ eprintf("stderr: not a tty
");
- if (fstat(STDIN_FILENO, &sb) < 0)
- eprintf("fstat stdin:");
+ if (fstat(STDERR_FILENO, &sb) < 0)
+ eprintf("fstat stderr:");
if (argc == 0) {
puts(sb.st_mode & (S_IWGRP | S_IWOTH) ? "is y" : "is n");
_AT_@ -46,8 +46,8 @@ main(int argc, char *argv[])
else
usage();
- if (fchmod(STDIN_FILENO, mode) < 0)
- eprintf("fchmod stdin:");
+ if (fchmod(STDERR_FILENO, mode) < 0)
+ eprintf("fchmod stderr:");
return EXIT_SUCCESS;
}
Received on Mon Aug 04 2014 - 22:04:11 CEST
This archive was generated by hypermail 2.3.0
: Mon Aug 04 2014 - 22:12:10 CEST