fix fd assignment on tty close

This commit is contained in:
igor.socec 2014-08-27 13:36:34 +02:00
parent 604665ee05
commit 5707b9e4e0

4
tty.c
View file

@ -66,8 +66,8 @@ int tty_close(struct tty_t *tty_dev) {
fprintf(stderr, "[%s] closing tty device \n", __func__);
if (tcsetattr(tty_dev->fd, TCSANOW, &(tty_dev->ttysetdef)) < 0) {
fprintf(stderr, "[%s] error restorting tty device default config\n", __func__);
if (tcsetattr(fd, TCSANOW, &(tty_dev->ttysetdef)) < 0) {
fprintf(stderr, "[%s] error restoring tty device default config\n", __func__);
return -errno;
}