Commit 0cae873b authored by Konrad Sztyber's avatar Konrad Sztyber
Browse files

sock: set errno in spdk_sock_flush()



All the other spdk_sock_* functions return -1 and set errno
appropriately, so we should do the same in flush().

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I51cda2c51974c72e82531f06fa31ab89b2329c91
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15642


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 3bc7e8f0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -516,7 +516,8 @@ int
spdk_sock_flush(struct spdk_sock *sock)
{
	if (sock == NULL || sock->flags.closed) {
		return -EBADF;
		errno = EBADF;
		return -1;
	}

	/* Sock is in a polling group, so group polling mechanism will work */
+2 −1
Original line number Diff line number Diff line
@@ -805,7 +805,8 @@ _sock_close(const char *ip, int port, char *impl_name)

	/* Test spdk_sock_flush when sock is NULL */
	rc = spdk_sock_flush(NULL);
	CU_ASSERT(rc == -EBADF);
	CU_ASSERT(rc == -1);
	CU_ASSERT(errno == EBADF);

	/* Test spdk_sock_flush when sock is not NULL */
	rc = spdk_sock_flush(client_sock);