summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.c
diff options
context:
space:
mode:
authorKarel Zak2017-10-10 14:45:55 +0200
committerKarel Zak2017-10-10 14:45:55 +0200
commit87ac63c9fa14a71084711eda8d4ddf6ad9515ce3 (patch)
tree49b7f72e268895115bb53674437fe878458c437f /misc-utils/logger.c
parentlogger: reconnect on failed send() (diff)
downloadkernel-qcow2-util-linux-87ac63c9fa14a71084711eda8d4ddf6ad9515ce3.tar.gz
kernel-qcow2-util-linux-87ac63c9fa14a71084711eda8d4ddf6ad9515ce3.tar.xz
kernel-qcow2-util-linux-87ac63c9fa14a71084711eda8d4ddf6ad9515ce3.zip
logger: add dummy fallback for OSX
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/logger.c')
-rw-r--r--misc-utils/logger.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index f8dbb2cef..bf2db9c6c 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -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)