X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flog.c;h=28bfb9a1e133bf63d3c5d8039b9ac155d4cff4e6;hb=b95cf3629e8d78a0d28e71b0f5559fa9a8c038b5;hp=a47285cb2129130e463ed822767ac1fa501d3088;hpb=541d6159c6b82c6786730d70b761d1aefffa8deb;p=elogind.git diff --git a/src/log.c b/src/log.c index a47285cb2..28bfb9a1e 100644 --- a/src/log.c +++ b/src/log.c @@ -227,10 +227,10 @@ static int write_to_console( if (show_location) IOVEC_SET_STRING(iovec[n++], location); if (highlight) - IOVEC_SET_STRING(iovec[n++], "\x1B[1;31m"); + IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_ON); IOVEC_SET_STRING(iovec[n++], buffer); if (highlight) - IOVEC_SET_STRING(iovec[n++], "\x1B[0m"); + IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_OFF); IOVEC_SET_STRING(iovec[n++], "\n"); if (writev(console_fd, iovec, n) < 0) @@ -279,7 +279,7 @@ static int write_to_syslog( msghdr.msg_iov = iovec; msghdr.msg_iovlen = ELEMENTSOF(iovec); - if (sendmsg(syslog_fd, &msghdr, 0) < 0) + if (sendmsg(syslog_fd, &msghdr, MSG_NOSIGNAL) < 0) return -errno; return 1;