/*
* Remove the file descriptor from the select bit maps
*/
- if (!(con->in.flags & HCON_UNUSED))
+ if (!(con->in.flags & HCON_UNUSED) && con->in.fd >= 0)
FD_CLR(con->in.fd, &gdb_crfds);
- if (!(con->out.flags & HCON_UNUSED))
+ if (!(con->out.flags & HCON_UNUSED) && con->out.fd >= 0)
FD_CLR(con->out.fd, &gdb_cwfds);
/*
* Close the file descriptor. Note, this presumes that in fact