[PATCH] Wrong usage of HAVE_DECL_MSG_NOSIGNAL macros so build fails on Solaris
Brian Cameron
brian.cameron at oracle.com
Thu Dec 30 08:54:35 PST 2010
Pavel:
See here:
https://bugs.freedesktop.org/show_bug.cgi?id=32540
Brian
On 12/30/10 08:57 AM, Pavel Strashkin wrote:
> Hello everyone,
>
> Solaris doesn't support MSG_NOSIGNAL so configure script puts the
> following lines into config.h:
> ===BEG===
> 151 /* Define to 1 if you have the declaration of `MSG_NOSIGNAL', and
> to 0 if you
> 152 don't. */
> 153 #define HAVE_DECL_MSG_NOSIGNAL 0
> ===END===
>
> As you can see, HAVE_DECL_MSG_NOSIGNAL macros is defined and it's
> value is 0. In code you check not value, but defined/notdefined
> situation that's wrong.
> For an example:
> ===BEG===
> 236 #ifdef HAVE_DECL_MSG_NOSIGNAL
> 237 static dbus_bool_t _dbus_modify_sigpipe = FALSE;
> 238 #else
> 239 static dbus_bool_t _dbus_modify_sigpipe = TRUE;
> 240 #endif
> ===END===
>
> As you understand now, the check will always true (even if
> MSG_NOSIGNAL is not supported) because macros always defined. You have
> to use "if" instead of "ifdef" in case of HAVE_* macroses to check for
> 0 or 1 i think.
>
> The attached patch fixes this case.
>
>
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
More information about the dbus
mailing list