summaryrefslogtreecommitdiffstats
path: root/tools/hv
diff options
context:
space:
mode:
authorTomas Hozza <thozza@redhat.com>2013-06-27 13:52:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-26 16:40:41 -0700
commit5c2892698184bf82e1f7d5c557ad81c9570b569a (patch)
tree3a0efe05ca1dd9566c96d007dd09020ec51cd957 /tools/hv
parent783c2fb1b8ba2f057a26f881aa452d4aa8e4b3f4 (diff)
downloadlinux-5c2892698184bf82e1f7d5c557ad81c9570b569a.tar.bz2
tools: hv: Improve error logging in VSS daemon.
Use errno and strerror() when logging errors to provide more information. Signed-off-by: Tomas Hozza <thozza@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r--tools/hv/hv_vss_daemon.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index fea03a3edaf4..64112e193552 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -156,7 +156,8 @@ int main(void)
fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
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);
}
addr.nl_family = AF_NETLINK;
@@ -167,7 +168,7 @@ int main(void)
error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (error < 0) {
- syslog(LOG_ERR, "bind failed; error:%d", error);
+ syslog(LOG_ERR, "bind failed; error:%d %s", errno, strerror(errno));
close(fd);
exit(EXIT_FAILURE);
}
@@ -187,7 +188,7 @@ int main(void)
len = netlink_send(fd, message);
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);
exit(EXIT_FAILURE);
}
@@ -241,7 +242,8 @@ int main(void)
vss_msg->error = error;
len = netlink_send(fd, incoming_cn_msg);
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);
}
}