Mercurial > emacs
changeset 68146:e5c85a134e67
[HAVE_INTTYPES_H]: Include inttypes.h.
(ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE).
(Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK
macro. Also try member ifr_addr when getting netmask.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Thu, 12 Jan 2006 08:15:50 +0000 |
parents | d88b44855af3 |
children | ead022af8d81 |
files | src/process.c |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/process.c Thu Jan 12 08:14:58 2006 +0000 +++ b/src/process.c Thu Jan 12 08:15:50 2006 +0000 @@ -40,6 +40,9 @@ #include <sys/types.h> /* some typedefs are used in sys/file.h */ #include <sys/file.h> #include <sys/stat.h> +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -3596,8 +3599,8 @@ #ifdef IFF_DYNAMIC { IFF_DYNAMIC, "dynamic" }, #endif -#ifdef IFF_OACTIV - { IFF_OACTIV, "oactiv" }, /* OpenBSD: transmission in progress */ +#ifdef IFF_OACTIVE + { IFF_OACTIVE, "oactive" }, /* OpenBSD: transmission in progress */ #endif #ifdef IFF_SIMPLEX { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */ @@ -3683,11 +3686,15 @@ res = Fcons (elt, res); elt = Qnil; -#if defined(SIOCGIFNETMASK) && defined(ifr_netmask) +#if defined(SIOCGIFNETMASK) && (defined(HAVE_STRUCT_IFREQ_IFR_NETMASK) || defined(HAVE_STRUCT_IFREQ_IFR_ADDR)) if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) { any++; +#ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); +#else + elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr)); +#endif } #endif res = Fcons (elt, res);