Commit 0254ef6d authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Change-Id: Id4845b77114aef32bbe4ea0e53d2e1fde8e116f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7204


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent c6b9113b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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;