diff options
author | David Howells <dhowells@redhat.com> | 2017-04-06 10:11:56 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-04-06 10:11:56 +0100 |
commit | 3a92789af0d625caff1e0bf5701aec8edf0d057d (patch) | |
tree | 8ad074e2048b742c7c4e8aebfbb3aeadc552a525 /net/rxrpc/recvmsg.c | |
parent | faeeb317a5615076dff1ff44b51e862e6064dbd0 (diff) | |
download | op-kernel-dev-3a92789af0d625caff1e0bf5701aec8edf0d057d.zip op-kernel-dev-3a92789af0d625caff1e0bf5701aec8edf0d057d.tar.gz |
rxrpc: Use negative error codes in rxrpc_call struct
Use negative error codes in struct rxrpc_call::error because that's what
the kernel normally deals with and to make the code consistent. We only
turn them positive when transcribing into a cmsg for userspace recvmsg.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/recvmsg.c')
-rw-r--r-- | net/rxrpc/recvmsg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c index 3e2f1a8..ad1a815 100644 --- a/net/rxrpc/recvmsg.c +++ b/net/rxrpc/recvmsg.c @@ -83,11 +83,11 @@ static int rxrpc_recvmsg_term(struct rxrpc_call *call, struct msghdr *msg) ret = put_cmsg(msg, SOL_RXRPC, RXRPC_ABORT, 4, &tmp); break; case RXRPC_CALL_NETWORK_ERROR: - tmp = call->error; + tmp = -call->error; ret = put_cmsg(msg, SOL_RXRPC, RXRPC_NET_ERROR, 4, &tmp); break; case RXRPC_CALL_LOCAL_ERROR: - tmp = call->error; + tmp = -call->error; ret = put_cmsg(msg, SOL_RXRPC, RXRPC_LOCAL_ERROR, 4, &tmp); break; default: @@ -689,7 +689,7 @@ excess_data: goto out; call_complete: *_abort = call->abort_code; - ret = -call->error; + ret = call->error; if (call->completion == RXRPC_CALL_SUCCEEDED) { ret = 1; if (size > 0) |