diff options
author | Jim Rees <rees@cvs.openbsd.org> | 2001-07-16 22:03:39 +0000 |
---|---|---|
committer | Jim Rees <rees@cvs.openbsd.org> | 2001-07-16 22:03:39 +0000 |
commit | aeb3beef72c766899fae2129b42b4baff5c78e2f (patch) | |
tree | 3cf88ce0d6c83be96075f8fe62336e0b3cf5d8eb /lib/libsectok/scio.c | |
parent | 217678283d073a57ec407cace389b4e29f2c51f3 (diff) |
fix millert's fdset patch (free fdset when done)
Diffstat (limited to 'lib/libsectok/scio.c')
-rw-r--r-- | lib/libsectok/scio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libsectok/scio.c b/lib/libsectok/scio.c index 2c1265bf00e..b6c7731e74e 100644 --- a/lib/libsectok/scio.c +++ b/lib/libsectok/scio.c @@ -1,4 +1,4 @@ -/* $Id: scio.c,v 1.6 2001/07/16 22:01:22 rees Exp $ */ +/* $Id: scio.c,v 1.7 2001/07/16 22:03:38 rees Exp $ */ /* copyright 1997 @@ -395,15 +395,20 @@ scgetc(int ttyn, unsigned char *cp, int ms) tvp = &tv; } - if (select(fd + 1, fdset, NULL, NULL, tvp) != 1) + if (select(fd + 1, fdset, NULL, NULL, tvp) != 1) { + free(fdset); return SCTIMEO; + } - if (read(fd, cp, 1) != 1) + if (read(fd, cp, 1) != 1) { + free(fdset); return SCTIMEO; + } if (sc[ttyn].flags & SCOINVRT) *cp = todos_scinvert[*cp]; + free(fdset); return SCEOK; /* 0 */ } |