diff options
author | Karel Zak | 2017-10-10 14:45:55 +0200 |
---|---|---|
committer | Karel Zak | 2017-10-10 14:45:55 +0200 |
commit | 87ac63c9fa14a71084711eda8d4ddf6ad9515ce3 (patch) | |
tree | 49b7f72e268895115bb53674437fe878458c437f /misc-utils/logger.c | |
parent | logger: reconnect on failed send() (diff) | |
download | kernel-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.c | 7 |
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) |