From: Patrick Caulfield <pcaulfie@redhat.com>
To: davem@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] DECnet return codes
Date: Thu, 4 Nov 2004 09:08:28 +0000 [thread overview]
Message-ID: <20041104090828.GE26743@tykepenguin.com> (raw)
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 <patrick@tykepenguin.com>
===== 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;
}
reply other threads:[~2004-11-04 9:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041104090828.GE26743@tykepenguin.com \
--to=pcaulfie@redhat.com \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®