[PATCH] Wrong usage of HAVE_DECL_MSG_NOSIGNAL macros so build fails on Solaris
Pavel Strashkin
pavel.strashkin at gmail.com
Thu Dec 30 06:57:10 PST 2010
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HAVE_DECL_MSG_NOSIGNAL.diff
Type: application/octet-stream
Size: 1865 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20101230/ed1d826a/attachment.obj>
More information about the dbus
mailing list