Skip to content

Commit

Permalink
If we have a problem sending a message via syslog, try (at least) to …
Browse files Browse the repository at this point in the history
…report

it via STDERR.
  • Loading branch information
tjsaunders committed Oct 12, 2014
1 parent 3b50536 commit 299ab64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pr-syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ static void pr_vsyslog(int sockfd, int pri, register const char *fmt,
}

#ifndef HAVE_DEV_LOG_STREAMS
send(sockfd, logbuf, buflen, 0);
if (send(sockfd, logbuf, buflen, 0) < 0) {
fprintf(stderr, "error sending log message '%s' to socket fd %d: %s\n",
logbuf, sockfd, strerror(errno));
}
#else

/* Prepare the structs for use by putmsg(). As /dev/log (or /dev/conslog)
Expand Down

0 comments on commit 299ab64

Please sign in to comment.