chiark / gitweb /
sd-daemon.c: allow use of -lrt to be avoided
[elogind.git] / src / libsystemd-daemon / sd-daemon.c
index 79d8ca3709ae143c62784174801a5d770dde6793..9cc1c37b468ce6e8ee84a110c419dc49768fb7b2 100644 (file)
@@ -47,7 +47,7 @@
 #include <stddef.h>
 #include <limits.h>
 
-#if defined(__linux__)
+#if defined(__linux__) && !defined(SD_DAEMON_DISABLE_MQ)
 #  include <mqueue.h>
 #endif
 
@@ -84,7 +84,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) {
         errno = 0;
         l = strtoul(e, &p, 10);
 
-        if (errno != 0) {
+        if (errno > 0) {
                 r = -errno;
                 goto finish;
         }
@@ -109,7 +109,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) {
         errno = 0;
         l = strtoul(e, &p, 10);
 
-        if (errno != 0) {
+        if (errno > 0) {
                 r = -errno;
                 goto finish;
         }
@@ -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) {
-#if !defined(__linux__)
+#if !defined(__linux__) || defined(SD_DAEMON_DISABLE_MQ)
         return 0;
 #else
         struct mq_attr attr;