diff options
author | Rob Landley <rob@landley.net> | 2018-01-14 23:15:01 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-01-14 23:15:01 -0600 |
commit | 4577605121fa441e5a28c32ce2c33be4c48df89b (patch) | |
tree | 2aededdb126dc5bf40bc51d0e6b0293ad28f0221 /toys/other | |
parent | e1d68f5006f553669a64a225d0f6b92a76c90179 (diff) | |
download | toybox-4577605121fa441e5a28c32ce2c33be4c48df89b.tar.gz |
Switch xgettty() -> tty_fd() (returning -1 instead of erroring out if none).
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/reset.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |