From: Paul Eggert Date: Sun, 13 Jan 2013 18:36:53 +0000 (-0800) Subject: net_if-tests: port to Solaris 7 + GCC 3.4.6 X-Git-Tag: v0.1~246 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=90f05b3db0553b0eb60a3a1b7bb4c2fbb2ef69dd;p=gnulib.git net_if-tests: port to Solaris 7 + GCC 3.4.6 Problem reported by Tom G. Christensen in . * tests/test-net_if.c (ni): Move to next the code that uses it, so that it's declared only if needed. --- diff --git a/ChangeLog b/ChangeLog index 79f857eb5e..7cb6f97772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-01-13 Paul Eggert + + net_if-tests: port to Solaris 7 + GCC 3.4.6 + Problem reported by Tom G. Christensen in + . + * tests/test-net_if.c (ni): Move to next the code that uses it, + so that it's declared only if needed. + 2013-01-12 Paul Eggert net_if-tests: port to older Solaris diff --git a/tests/test-net_if.c b/tests/test-net_if.c index 13ca82ef3d..932f3e34e6 100644 --- a/tests/test-net_if.c +++ b/tests/test-net_if.c @@ -20,8 +20,6 @@ #include -static struct if_nameindex ni; - /* We do not yet have replacements for if_* functions on systems that lack a native . */ #if HAVE_NET_IF_H && HAVE_IF_NAMEINDEX @@ -90,7 +88,10 @@ main (int argc, char *argv[]) #endif /* HAVE_NET_IF_H */ #if !HAVE_NET_IF_H || HAVE_IF_NAMEINDEX - return !IF_NAMESIZE + ni.if_index + !!ni.if_name; + { + static struct if_nameindex ni; + return !IF_NAMESIZE + ni.if_index + !!ni.if_name; + } #else return 0; #endif