explicately cast ioctl() to int since it it not always declared

This commit is contained in:
Todd C. Miller
1996-06-20 04:43:25 +00:00
parent 08470fd767
commit 5fc1d4b79c

View File

@@ -133,9 +133,9 @@ void load_interfaces()
/* networking may not be installed in kernel */ /* networking may not be installed in kernel */
#ifdef _ISC #ifdef _ISC
STRSET(SIOCGIFCONF, (caddr_t) ifconf, sizeof(ifconf_buf)); STRSET(SIOCGIFCONF, (caddr_t) ifconf, sizeof(ifconf_buf));
if (ioctl(sock, I_STR, (caddr_t) &strioctl) < 0) if ((int) ioctl(sock, I_STR, (caddr_t) &strioctl) < 0)
#else #else
if (ioctl(sock, SIOCGIFCONF, (caddr_t) ifconf) < 0) if ((int) ioctl(sock, SIOCGIFCONF, (caddr_t) ifconf) < 0)
#endif /* _ISC */ #endif /* _ISC */
return; return;
@@ -181,9 +181,9 @@ void load_interfaces()
/* get the ip address */ /* get the ip address */
#ifdef _ISC #ifdef _ISC
STRSET(SIOCGIFADDR, (caddr_t) &ifreq, sizeof(ifreq)); STRSET(SIOCGIFADDR, (caddr_t) &ifreq, sizeof(ifreq));
if (ioctl(sock, I_STR, (caddr_t) &strioctl) < 0) { if ((int) ioctl(sock, I_STR, (caddr_t) &strioctl) < 0) {
#else #else
if (ioctl(sock, SIOCGIFADDR, (caddr_t) &ifreq)) { if ((int) ioctl(sock, SIOCGIFADDR, (caddr_t) &ifreq)) {
#endif /* _ISC */ #endif /* _ISC */
/* non-fatal error if interface is down or not supported */ /* non-fatal error if interface is down or not supported */
if (errno == EADDRNOTAVAIL || errno == ENXIO || errno == EAFNOSUPPORT) if (errno == EADDRNOTAVAIL || errno == ENXIO || errno == EAFNOSUPPORT)
@@ -202,9 +202,9 @@ void load_interfaces()
#ifdef SIOCGIFNETMASK #ifdef SIOCGIFNETMASK
#ifdef _ISC #ifdef _ISC
STRSET(SIOCGIFNETMASK, (caddr_t) &ifreq, sizeof(ifreq)); STRSET(SIOCGIFNETMASK, (caddr_t) &ifreq, sizeof(ifreq));
if (ioctl(sock, I_STR, (caddr_t) &strioctl) == 0) { if ((int) ioctl(sock, I_STR, (caddr_t) &strioctl) == 0) {
#else #else
if (ioctl(sock, SIOCGIFNETMASK, (caddr_t) &ifreq) == 0) { if ((int) ioctl(sock, SIOCGIFNETMASK, (caddr_t) &ifreq) == 0) {
#endif /* _ISC */ #endif /* _ISC */
sin = (struct sockaddr_in *) &ifreq.ifr_addr; sin = (struct sockaddr_in *) &ifreq.ifr_addr;