diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libply/ply-terminal.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 * |
