aboutsummaryrefslogtreecommitdiff
path: root/toys/tty.c
blob: c6eeac0a13e0c53222eb62ba0fd6b191f92b8585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "toys.h"

int tty_main(void)
{
	char *name = ttyname(0);
	if (!toys.optflags) {
		if (name)
			puts(name);
		else
			puts("Not a tty");
	}
	return !name;
}