From 58314c2800d88819305b302bfdf51b4e73ba34bf Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 28 Jan 2013 18:41:08 +0100 Subject: [PATCH] core: log when sendmsg fails Reported by Coverity as CID #970962, #970963. --- core/notify.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/notify.c b/core/notify.c index 900c59e7..4a550aa4 100644 --- a/core/notify.c +++ b/core/notify.c @@ -20,7 +20,9 @@ void uwsgi_systemd_notify(char *message) { msghdr->msg_iovlen = 3; - sendmsg(uwsgi.notification_fd, msghdr, 0); + if (sendmsg(uwsgi.notification_fd, msghdr, 0) < 0) { + uwsgi_error("sendmsg()"); + } } void uwsgi_systemd_notify_ready(void) { @@ -33,8 +35,9 @@ void uwsgi_systemd_notify_ready(void) { msghdr->msg_iovlen = 1; - sendmsg(uwsgi.notification_fd, msghdr, 0); - + if (sendmsg(uwsgi.notification_fd, msghdr, 0) < 0) { + uwsgi_error("sendmsg()"); + } }