Make ply_terminal_set_fd() update terminal->name .

This commit is contained in:
Peter Jones 2008-06-03 14:52:33 -04:00 committed by Peter Jones
parent 38170ab182
commit 4c1b2fc6b7

View file

@ -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 *