2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netlink-socket: Convert from error number to string correctly.

As mentioned in the comment above the function ovs_strerror(), it
should not be used to convert WINAPI error numbers to string.
Use ovs_lasterror_to_string() instead.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
This commit is contained in:
Gurucharan Shetty
2014-09-09 11:55:45 -07:00
parent 2ea8241431
commit 52a1540a7f

View File

@@ -147,16 +147,14 @@ nl_sock_create(int protocol, struct nl_sock **sockp)
FILE_FLAG_OVERLAPPED, NULL);
if (sock->handle == INVALID_HANDLE_VALUE) {
int last_error = GetLastError();
VLOG_ERR("fcntl: %s", ovs_strerror(last_error));
VLOG_ERR("fcntl: %s", ovs_lasterror_to_string());
goto error;
}
memset(&sock->overlapped, 0, sizeof sock->overlapped);
sock->overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (sock->overlapped.hEvent == NULL) {
int last_error = GetLastError();
VLOG_ERR("fcntl: %s", ovs_strerror(last_error));
VLOG_ERR("fcntl: %s", ovs_lasterror_to_string());
goto error;
}