/* The name under which this program was run. */
char *program_name;
-/* If nonzero, return an exit status but produce no output. */
-static int silent;
+/* If true, return an exit status but produce no output. */
+static bool silent;
static struct option const longopts[] =
{
initialize_exit_failure (TTY_WRITE_ERROR);
atexit (close_stdout);
- silent = 0;
+ silent = false;
while ((optc = getopt_long (argc, argv, "s", longopts, NULL)) != -1)
{
break;
case 's':
- silent = 1;
+ silent = true;
break;
case_GETOPT_HELP_CHAR;
if (optind < argc)
error (0, 0, _("extra operand %s"), quote (argv[optind]));
- tty = ttyname (0);
+ tty = ttyname (STDIN_FILENO);
if (!silent)
{
if (tty)
puts (_("not a tty"));
}
- exit (isatty (0) ? EXIT_SUCCESS : EXIT_FAIL);
+ exit (isatty (STDIN_FILENO) ? EXIT_SUCCESS : EXIT_FAIL);
}