fputs(USAGE_OPTIONS, out);
fputs(_(" -v, --verbose explain what is being done\n"), out);
- print_usage_help_options(16);
- fprintf(out, USAGE_MAN_TAIL("mesg(1)"));
+ printf(USAGE_HELP_OPTIONS(16));
+ printf(USAGE_MAN_TAIL("mesg(1)"));
exit(EXIT_SUCCESS);
}
argc -= optind;
argv += optind;
+ if (!isatty(STDERR_FILENO)) {
+ if (verbose)
+ warnx(_("no tty"));
+ exit(MESG_EXIT_FAILURE);
+ }
if ((tty = ttyname(STDERR_FILENO)) == NULL)
err(MESG_EXIT_FAILURE, _("ttyname failed"));
if ((fd = open(tty, O_RDONLY)) < 0)