Commit 8181153d authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

net: move more common code out of posix routines

parent 7ae63b0d
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -343,11 +343,6 @@ spdk_posix_sock_recv(struct spdk_sock *_sock, void *buf, size_t len)
{
	struct spdk_posix_sock *sock = __posix_sock(_sock);

	if (sock == NULL) {
		errno = EBADF;
		return -1;
	}

	return recv(sock->fd, buf, len, MSG_DONTWAIT);
}

@@ -356,11 +351,6 @@ spdk_posix_sock_writev(struct spdk_sock *_sock, struct iovec *iov, int iovcnt)
{
	struct spdk_posix_sock *sock = __posix_sock(_sock);

	if (sock == NULL) {
		errno = EBADF;
		return -1;
	}

	return writev(sock->fd, iov, iovcnt);
}

@@ -616,12 +606,22 @@ spdk_sock_close(struct spdk_sock **sock)
ssize_t
spdk_sock_recv(struct spdk_sock *sock, void *buf, size_t len)
{
	if (sock == NULL) {
		errno = EBADF;
		return -1;
	}

	return spdk_posix_sock_recv(sock, buf, len);
}

ssize_t
spdk_sock_writev(struct spdk_sock *sock, struct iovec *iov, int iovcnt)
{
	if (sock == NULL) {
		errno = EBADF;
		return -1;
	}

	return spdk_posix_sock_writev(sock, iov, iovcnt);
}