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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user