if (scb)
{
fd_set rset, wset, eset;
+
FD_ZERO (&rset);
FD_SET (scb->fd, &rset);
wset = rset;
else
scb->fd = socket (PF_INET, SOCK_STREAM, 0);
- if (scb->fd < 0)
+ if (scb->fd == -1)
return -1;
/* set socket nonblocking */
{
int res, err;
socklen_t len;
+
len = sizeof (err);
/* On Windows, the fourth parameter to getsockopt is a "char *";
on UNIX systems it is generally "void *". The cast to "void *"
void
net_close (struct serial *scb)
{
- if (scb->fd < 0)
+ if (scb->fd == -1)
return;
close (scb->fd);
ser-mingw.c. */
#else
struct serial_ops *ops;
+
ops = XMALLOC (struct serial_ops);
memset (ops, 0, sizeof (struct serial_ops));
ops->name = "tcp";