From 4577605121fa441e5a28c32ce2c33be4c48df89b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 14 Jan 2018 23:15:01 -0600 Subject: Switch xgettty() -> tty_fd() (returning -1 instead of erroring out if none). --- toys/other/reset.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'toys/other') diff --git a/toys/other/reset.c b/toys/other/reset.c index 0c2089cc..aa9b74ea 100644 --- a/toys/other/reset.c +++ b/toys/other/reset.c @@ -18,6 +18,8 @@ config RESET void reset_main(void) { - // man 4 console codes: reset terminal is ESC (no left bracket) c - xwrite(xgettty(), "\033c", 2); + int fd = tty_fd(); + + // man 4 console_codes: reset terminal is ESC (no left bracket) c + xwrite(fd<0 ? 1 : fd, "\033c", 2); } -- cgit v1.2.3