]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
logger: add dummy fallback for OSX
authorKarel Zak <kzak@redhat.com>
Tue, 10 Oct 2017 12:45:55 +0000 (14:45 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Oct 2017 12:45:55 +0000 (14:45 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.c

index f8dbb2cef9687f9f7b933ca2fe62ffe8612ac2f3..bf2db9c6cf02a70c9656c7786a554005b1741c02 100644 (file)
@@ -489,8 +489,13 @@ static void write_output(struct logger_ctl *ctl, const char *const msg)
                 *
                 * The libc syslog() function reconnects on failed send().
                 * Let's do the same to be robust.    [kzak -- Oct 2017]
+                *
+                * MSG_NOSIGNAL is POSIX.1-2008 compatible, but it for example
+                * no suported by apple-darwin15.6.0.
                 */
-
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+#endif
                if (sendmsg(ctl->fd, &message, MSG_NOSIGNAL) < 0) {
                        logger_reopen(ctl);
                        if (sendmsg(ctl->fd, &message, MSG_NOSIGNAL) < 0)