chiark / gitweb /
sd-daemon.c: allow use of -lrt to be avoided
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 5 Apr 2013 12:35:22 +0000 (13:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Apr 2013 11:54:31 +0000 (13:54 +0200)
In recent glibc, many commonly-used librt functions have moved
from librt to libc. This results in dbus' configure.ac
concluding that we don't need to link in librt. However,
sd-daemon.c needs it for mq_getattr(), causing the build
to fail.

dbus doesn't use POSIX message queues, so I'd prefer to be
able to avoid "if on Linux, link librt for sd-daemon.c".

src/libsystemd-daemon/sd-daemon.c

index b1ff43132a3cc89a03fb3f68bc12c6ddeca233ea..9cc1c37b468ce6e8ee84a110c419dc49768fb7b2 100644 (file)
@@ -47,7 +47,7 @@
 #include <stddef.h>
 #include <limits.h>
 
 #include <stddef.h>
 #include <limits.h>
 
-#if defined(__linux__)
+#if defined(__linux__) && !defined(SD_DAEMON_DISABLE_MQ)
 #  include <mqueue.h>
 #endif
 
 #  include <mqueue.h>
 #endif
 
@@ -387,7 +387,7 @@ _sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *p
 }
 
 _sd_export_ int sd_is_mq(int fd, const char *path) {
 }
 
 _sd_export_ int sd_is_mq(int fd, const char *path) {
-#if !defined(__linux__)
+#if !defined(__linux__) || defined(SD_DAEMON_DISABLE_MQ)
         return 0;
 #else
         struct mq_attr attr;
         return 0;
 #else
         struct mq_attr attr;