return r;
}
-int reset_terminal(const char *name) {
- _cleanup_close_ int fd = -EBADF;
-
- /* We open the terminal with O_NONBLOCK here, to ensure we
- * don't block on carrier if this is a terminal with carrier
- * configured. */
-
- fd = open_terminal(name, O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK);
- if (fd < 0)
- return fd;
-
- return reset_terminal_fd(fd, true);
-}
-
int open_terminal(const char *name, int mode) {
_cleanup_close_ int fd = -EBADF;
unsigned c = 0;
bool isatty_safe(int fd);
int reset_terminal_fd(int fd, bool switch_to_text);
-int reset_terminal(const char *name);
int terminal_reset_ansi_seq(int fd);
int terminal_reset_defensive(int fd, bool switch_to_text);