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: Patrick Caulfield <[email protected]>
===== include/net/dn_nsp.h 1.6 vs edited =====
--- 1.6/include/net/dn_nsp.h 2004-02-18 21:15:52 +00:00
+++ edited/include/net/dn_nsp.h 2004-10-28 15:40:47 +01:00
@@ -37,7 +37,7 @@
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_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_NR 1 /* No resources */
===== net/decnet/af_decnet.c 1.44 vs edited =====
--- 1.44/net/decnet/af_decnet.c 2004-06-05 23:55:10 +01:00
+++ edited/net/decnet/af_decnet.c 2004-10-28 15:40:46 +01:00
@@ -1723,7 +1723,7 @@
goto out;
if (signal_pending(current)) {
- rv = -ERESTARTSYS;
+ rv = sock_intr_errno(timeo);
goto out;
}
@@ -1957,7 +1957,7 @@
goto out;
if (signal_pending(current)) {
- err = -ERESTARTSYS;
+ err = sock_intr_errno(timeo);
goto out;
}
@@ -1992,7 +1992,7 @@
/*
* 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)
break;
===== net/decnet/dn_nsp_out.c 1.11 vs edited =====
--- 1.11/net/decnet/dn_nsp_out.c 2004-02-18 21:15:52 +00:00
+++ edited/net/decnet/dn_nsp_out.c 2004-10-28 15:40:46 +01:00
@@ -141,7 +141,7 @@
* 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.
*/
-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 len;
@@ -151,7 +151,7 @@
while(skb == NULL) {
if (signal_pending(current)) {
- *err = ERESTARTSYS;
+ *err = sock_intr_errno(timeo);
break;
}