if (read(fd, cp, 1) != 1)
if (read(fd, cp, 1) != 1) { free(fdset);
scgetc(int ttyn, unsigned char *cp, int ms){    int fd = sc[ttyn].fd;    fd_set *fdset;    struct timeval tv, *tvp;#ifdef BYTECOUNT    num_getc++;#endif /* BYTECOUNT */        fdset = (fd_set *)calloc(howmany(fd + 1, NFDBITS), sizeof(fd_mask));    if (fdset == NULL)	return SCENOMEM;    FD_SET(fd, fdset);    if (ms == -1)	tvp = NULL;    else {	tv.tv_sec = (ms + 1) / 1000;	tv.tv_usec = (ms % 1000) * 1000;	tvp = &tv;    }    if (select(fd + 1, fdset, NULL, NULL, tvp) != 1)	return SCTIMEO;    if (read(fd, cp, 1) != 1)	return SCTIMEO;    if (sc[ttyn].flags & SCOINVRT)	*cp = todos_scinvert[*cp];    return SCEOK; /* 0 */}