diff options
author | David Howells <dhowells@redhat.com> | 2017-04-06 11:11:56 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-04-06 11:11:56 +0200 |
commit | 3a92789af0d625caff1e0bf5701aec8edf0d057d (patch) | |
tree | 8ad074e2048b742c7c4e8aebfbb3aeadc552a525 /net/rxrpc/recvmsg.c | |
parent | bonding: attempt to better support longer hw addresses (diff) | |
download | linux-3a92789af0d625caff1e0bf5701aec8edf0d057d.tar.xz linux-3a92789af0d625caff1e0bf5701aec8edf0d057d.zip |
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 3e2f1a8e9c5b..ad1a815b9706 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) |