Commit 5b8287df authored by Patrick Caulfield's avatar Patrick Caulfield Committed by David S. Miller

[DECNET]: Fix return codes

This patch fixes the return codes from sendmsg/recvmsg when a signal happens.
Instead of always returning ERESTARTSYS (which confuses X11 rather badly) it
should return EINTR for non-blocking operations.
Signed-off-by: default avatarPatrick Caulfield <patrick@tykepenguin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf3659b9
...@@ -37,7 +37,7 @@ extern int dn_nsp_rx(struct sk_buff *); ...@@ -37,7 +37,7 @@ extern int dn_nsp_rx(struct sk_buff *);
extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb); extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri); extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri);
extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, int *err); extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, long timeo, int *err);
#define NSP_REASON_OK 0 /* No error */ #define NSP_REASON_OK 0 /* No error */
#define NSP_REASON_NR 1 /* No resources */ #define NSP_REASON_NR 1 /* No resources */
......
...@@ -1723,7 +1723,7 @@ static int dn_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1723,7 +1723,7 @@ static int dn_recvmsg(struct kiocb *iocb, struct socket *sock,
goto out; goto out;
if (signal_pending(current)) { if (signal_pending(current)) {
rv = -ERESTARTSYS; rv = sock_intr_errno(timeo);
goto out; goto out;
} }
...@@ -1957,7 +1957,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1957,7 +1957,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock,
goto out; goto out;
if (signal_pending(current)) { if (signal_pending(current)) {
err = -ERESTARTSYS; err = sock_intr_errno(timeo);
goto out; goto out;
} }
...@@ -1992,7 +1992,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1992,7 +1992,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock,
/* /*
* Get a suitably sized skb. * Get a suitably sized skb.
*/ */
skb = dn_alloc_send_skb(sk, &len, flags & MSG_DONTWAIT, &err); skb = dn_alloc_send_skb(sk, &len, flags & MSG_DONTWAIT, timeo, &err);
if (err) if (err)
break; break;
......
...@@ -141,7 +141,7 @@ struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri) ...@@ -141,7 +141,7 @@ struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri)
* whole size thats been asked for (plus 11 bytes of header). If this * whole size thats been asked for (plus 11 bytes of header). If this
* fails, then we try for any size over 16 bytes for SOCK_STREAMS. * fails, then we try for any size over 16 bytes for SOCK_STREAMS.
*/ */
struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, int *err) struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, long timeo, int *err)
{ {
int space; int space;
int len; int len;
...@@ -151,7 +151,7 @@ struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, in ...@@ -151,7 +151,7 @@ struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock, in
while(skb == NULL) { while(skb == NULL) {
if (signal_pending(current)) { if (signal_pending(current)) {
*err = ERESTARTSYS; *err = sock_intr_errno(timeo);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment