Bug 39987 - dbus-1.4.12 fails to compile on solaris
Summary: dbus-1.4.12 fails to compile on solaris
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: All Solaris
: medium normal
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://cgit.freedesktop.org/~smcv/dbu...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks: dbus-1.4
  Show dependency treegraph
 
Reported: 2011-08-10 13:16 UTC by Daniel Vergien
Modified: 2013-04-03 11:22 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dbus-1.4.12-dbus-sysdeps-util-unix.c.patch (314 bytes, patch)
2011-08-10 13:16 UTC, Daniel Vergien
Details | Splinter Review
[1/2] Cope with Unixes that don't have LOG_PERROR, like Solaris 10 (2.11 KB, patch)
2011-08-23 08:15 UTC, Simon McVittie
Details | Splinter Review
[2/2] Add a semi-automatic test for _dbus_system_log (4.24 KB, patch)
2011-08-23 08:15 UTC, Simon McVittie
Details | Splinter Review
Change #ifdef to #if (701 bytes, patch)
2013-04-03 10:41 UTC, Dagobert Michelsen
Details | Splinter Review

Description Daniel Vergien 2011-08-10 13:16:34 UTC
Created attachment 50103 [details] [review]
dbus-1.4.12-dbus-sysdeps-util-unix.c.patch

In the file dbus/sysdeps-util-unix.c LOG_PERROR is used which is not define on solaris 10

A workaround is in the attached patch
Comment 1 Simon McVittie 2011-08-11 02:22:56 UTC
Does Solaris have a way to achieve the same effect as LOG_PERROR? In glibc, it's documented as:

       LOG_PERROR     (Not in POSIX.1-2001.)  Print to stderr as well.

and

       The LOG_PERROR value for option is not specified
       by POSIX.1-2001, but is available in most versions of UNIX.

If there isn't such a thing, we could either use a workaround similar to yours (and just not get output to stderr), or use both vsyslog() and vfprintf() to get output to syslog and stderr at the same time if LOG_PERROR doesn't exist.

(I'd prefer to do an autoconf check rather than #ifndef, though, because LOG_PERROR might be an enum member on some platforms.)
Comment 2 Dagobert Michelsen 2011-08-19 06:43:07 UTC
There is no equivalent to LOG_PERROR on Solaris.

The error is still present in 1.5.6 and it would be nice if it would be fixed.

Best regards -- Dago
Comment 3 Simon McVittie 2011-08-23 08:15:11 UTC
Created attachment 50497 [details] [review]
[1/2] Cope with Unixes that don't have LOG_PERROR, like  Solaris 10
Comment 4 Simon McVittie 2011-08-23 08:15:58 UTC
Created attachment 50498 [details] [review]
[2/2] Add a semi-automatic test for _dbus_system_log
Comment 5 Will Thompson 2011-09-21 01:09:05 UTC
Review of attachment 50497 [details] [review]:

Looks plausible.
Comment 6 Will Thompson 2011-09-21 01:12:27 UTC
Review of attachment 50498 [details] [review]:

This patch looks fine!

g_test_trap_* is nifty: I hadn't seen it before.
Comment 7 Will Thompson 2011-09-21 01:12:30 UTC
Review of attachment 50498 [details] [review]:

This patch looks fine!

g_test_trap_* is nifty: I hadn't seen it before.
Comment 8 Simon McVittie 2011-09-21 03:41:13 UTC
Fixed in git for 1.4.16 and 1.5.8, thanks
Comment 9 Dagobert Michelsen 2013-04-03 10:40:56 UTC
In GIT HEAD I just noticed that when LOG_PERROR is not defined the definition in config.h is
  #define HAVE_DECL_LOG_PERROR 0
which means that the check with #ifdef is always true. The attached patch changing this to #if resolves the issue.
Comment 10 Dagobert Michelsen 2013-04-03 10:41:45 UTC
Created attachment 77372 [details] [review]
Change #ifdef to #if
Comment 11 Dagobert Michelsen 2013-04-03 10:59:08 UTC
The error was just recently introduced in commit 88642f6fee46a4c6d1fde8ae221494a6b3188bd4
Comment 12 Simon McVittie 2013-04-03 11:22:50 UTC
Re-fixed in git for 1.7.2, thanks. As far as I can see, this was a regression in master which never affected a release.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.