From ca02fe9b77037d56dd01ea7b5d33eebb62983e44 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 25 May 2024 11:55:36 -0400 Subject: bfstd: New helper for open(ctermid()) --- src/bar.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/bar.c') diff --git a/src/bar.c b/src/bar.c index b928373..be77694 100644 --- a/src/bar.c +++ b/src/bar.c @@ -144,14 +144,7 @@ struct bfs_bar *bfs_bar_show(void) { return NULL; } - char term[L_ctermid]; - ctermid(term); - if (strlen(term) == 0) { - errno = ENOTTY; - goto fail; - } - - bar->fd = open(term, O_RDWR | O_CLOEXEC); + bar->fd = open_cterm(O_RDWR | O_CLOEXEC); if (bar->fd < 0) { goto fail; } -- cgit v1.2.3