[netperf-talk] OK, this time I really mean it?-)
Rick Jones
rick.jones2 at hp.com
Wed Jun 3 14:31:57 PDT 2009
Andrew Gallatin wrote:
>
>> Is there a #define that is consistently set when compiling on Solaris?
>
>
> The rest of the code seems to use __sun. I just tried this, and it
> seems to work.
>
> Drew
>
>
> ------------------------------------------------------------------------
>
> Index: nettest_bsd.c
> ===================================================================
> --- nettest_bsd.c (revision 301)
> +++ nettest_bsd.c (working copy)
> @@ -647,6 +647,11 @@
> int change_info = 0;
> static int change_warning_displayed = 0;
>
> +#ifdef __sun
> + if (!debug)
> + change_warning_displayed = -1;
> +#endif
> +
> int count = 0;
> int error = 0;
>
OK, try this then - it uses #ifdef __sun and restricts itself to the kludge for
the bug in question rather than all warnings:
raj at tardy:~/netperf2_trunk$ svn diff src/nettest_bsd.c
Index: src/nettest_bsd.c
===================================================================
--- src/nettest_bsd.c (revision 301)
+++ src/nettest_bsd.c (working copy)
@@ -813,8 +813,15 @@
/* if we dropped the protocol hint, it would be for a protocol that
getaddrinfo() wasn't supporting yet, not for the bug that it took
our hint and still returned zero. raj 2006-10-16 */
+ /* as there is now an open bug against (Open)Solaris on this
+ behaviour we will only emit this warning if debug is set under
+ Solaris and will continue to emit it under any circumstance on
+ other platforms should it arise. raj 2009-06-03 */
if ((change_info & CHANGED_PROTOCOL) &&
!(change_warning_displayed & CHANGED_PROTOCOL) &&
+#ifdef __sun
+ (debug) &&
+#endif
(hints.ai_protocol != 0)) {
change_warning_displayed |= CHANGED_PROTOCOL;
fprintf(where,
More information about the netperf-talk
mailing list