Commit 5c289269 authored by Tomas Hozza's avatar Tomas Hozza Committed by Greg Kroah-Hartman

tools: hv: Improve error logging in VSS daemon.

Use errno and strerror() when logging errors to provide more
information.
Signed-off-by: default avatarTomas Hozza <thozza@redhat.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 783c2fb1
...@@ -156,7 +156,8 @@ int main(void) ...@@ -156,7 +156,8 @@ int main(void)
fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
if (fd < 0) { if (fd < 0) {
syslog(LOG_ERR, "netlink socket creation failed; error:%d", fd); syslog(LOG_ERR, "netlink socket creation failed; error:%d %s",
errno, strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
addr.nl_family = AF_NETLINK; addr.nl_family = AF_NETLINK;
...@@ -167,7 +168,7 @@ int main(void) ...@@ -167,7 +168,7 @@ int main(void)
error = bind(fd, (struct sockaddr *)&addr, sizeof(addr)); error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (error < 0) { if (error < 0) {
syslog(LOG_ERR, "bind failed; error:%d", error); syslog(LOG_ERR, "bind failed; error:%d %s", errno, strerror(errno));
close(fd); close(fd);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -187,7 +188,7 @@ int main(void) ...@@ -187,7 +188,7 @@ int main(void)
len = netlink_send(fd, message); len = netlink_send(fd, message);
if (len < 0) { if (len < 0) {
syslog(LOG_ERR, "netlink_send failed; error:%d", len); syslog(LOG_ERR, "netlink_send failed; error:%d %s", errno, strerror(errno));
close(fd); close(fd);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -241,7 +242,8 @@ int main(void) ...@@ -241,7 +242,8 @@ int main(void)
vss_msg->error = error; vss_msg->error = error;
len = netlink_send(fd, incoming_cn_msg); len = netlink_send(fd, incoming_cn_msg);
if (len < 0) { if (len < 0) {
syslog(LOG_ERR, "net_link send failed; error:%d", len); syslog(LOG_ERR, "net_link send failed; error:%d %s",
errno, strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment