sbase/tty.c
FRIGN eee98ed3a4 Fix coding style
It was about damn time. Consistency is very important in such a
big codebase.
2014-11-13 18:08:43 +00:00

28 lines
376 B
C

/* See LICENSE file for copyright and license details. */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s\n", argv0);
}
int
main(int argc, char *argv[])
{
char *tty;
ARGBEGIN {
default:
usage();
} ARGEND;
tty = ttyname(STDIN_FILENO);
puts(tty ? tty : "not a tty");
return tty ? 0 : 1;
}