mirror of git://git.suckless.org/ubase
Only work with stderr in mesg
Previous commit was incomplete (damn git add -p).
This commit is contained in:
parent
af274ce48a
commit
1291687152
10
mesg.c
10
mesg.c
|
@ -29,10 +29,10 @@ main(int argc, char *argv[])
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (isatty(STDERR_FILENO) == 0)
|
if (isatty(STDERR_FILENO) == 0)
|
||||||
eprintf("stdin: not a tty\n");
|
eprintf("stderr: not a tty\n");
|
||||||
|
|
||||||
if (fstat(STDIN_FILENO, &sb) < 0)
|
if (fstat(STDERR_FILENO, &sb) < 0)
|
||||||
eprintf("fstat stdin:");
|
eprintf("fstat stderr:");
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
puts(sb.st_mode & (S_IWGRP | S_IWOTH) ? "is y" : "is n");
|
puts(sb.st_mode & (S_IWGRP | S_IWOTH) ? "is y" : "is n");
|
||||||
|
@ -46,8 +46,8 @@ main(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (fchmod(STDIN_FILENO, mode) < 0)
|
if (fchmod(STDERR_FILENO, mode) < 0)
|
||||||
eprintf("fchmod stdin:");
|
eprintf("fchmod stderr:");
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue