From 4c1b2fc6b76d973fb816ccc4445cf9be2e075385 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 3 Jun 2008 14:52:33 -0400 Subject: Make ply_terminal_set_fd() update terminal->name . --- src/libply/ply-terminal.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/libply/ply-terminal.c b/src/libply/ply-terminal.c index d51813e..9ad293f 100644 --- a/src/libply/ply-terminal.c +++ b/src/libply/ply-terminal.c @@ -140,6 +140,15 @@ ply_terminal_set_fd (ply_terminal_t *terminal, int fd) assert (terminal != NULL); terminal->fd = fd; + + if (terminal->name) + { + free(terminal->name); + terminal->name = NULL; + } + + if (terminal->fd >= 0) + terminal->name = strdup (ptsname (terminal->fd)); } const char * -- cgit