From: Philip Homburg Date: Fri, 14 Jul 2006 13:35:21 +0000 (+0000) Subject: Clear NONBLOCK flag after probing ethernet device. X-Git-Tag: v3.1.3~247 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/verify-sign/Bv9ARM.ch08.html?a=commitdiff_plain;h=371ac29c9f019f4163657505d499f081874f507b;p=minix.git Clear NONBLOCK flag after probing ethernet device. --- diff --git a/commands/dhcpd/devices.c b/commands/dhcpd/devices.c index 02944fb35..3d12a1648 100755 --- a/commands/dhcpd/devices.c +++ b/commands/dhcpd/devices.c @@ -173,12 +173,14 @@ int opendev(network_t *np, fdtype_t fdtype, int compete) switch (fdtype) { case FT_ETHERNET: + /* Set NONBLOCK to avoid waiting for a device driver to become ready */ fcntl(np->fdp->fd, F_SETFL, fcntl(np->fdp->fd, F_GETFL) | O_NONBLOCK); if (ioctl(np->fdp->fd, NWIOGETHSTAT, ðstat) < 0) { /* Not an Ethernet. */ close(fdp->fd); return 0; } + fcntl(np->fdp->fd, F_SETFL, fcntl(np->fdp->fd, F_GETFL) & ~O_NONBLOCK); np->eth= ethstat.nwes_addr; ethopt.nweo_flags= NWEO_COPY | NWEO_EN_LOC | NWEO_EN_BROAD | NWEO_REMANY | NWEO_TYPEANY | NWEO_RWDATALL;