sock: Fix return code for adding a socket to a group twice

Also fix the comment. It's never going to make sense to add a socket
to a group twice.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Id4845b77114aef32bbe4ea0e53d2e1fde8e116f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7204
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Ben Walker 2021-03-29 12:15:55 -07:00 committed by Jim Harris
parent c6b9113ba7
commit 0254ef6d2b
2 changed files with 3 additions and 4 deletions

View File

@ -547,10 +547,9 @@ spdk_sock_group_add_sock(struct spdk_sock_group *group, struct spdk_sock *sock,
if (sock->group_impl != NULL) {
/*
* This sock is already part of a sock_group. Currently we don't
* support this.
* This sock is already part of a sock_group.
*/
errno = EBUSY;
errno = EINVAL;
return -1;
}

View File

@ -540,7 +540,7 @@ _sock_group(const char *ip, int port, char *impl_name)
/* try adding sock a second time */
rc = spdk_sock_group_add_sock(group, server_sock, read_data, server_sock);
CU_ASSERT(rc == -1);
CU_ASSERT(errno == EBUSY);
CU_ASSERT(errno == EINVAL);
g_read_data_called = false;
g_bytes_read = 0;