From: Samuel Ortiz <samuel@sortiz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, irda-users@lists.sourceforge.net
Subject: [PATCH 1/3] [IrDA] MSG_NOSIGNAL support for IrDA sockets
Date: Mon, 27 Aug 2007 01:15:15 +0300 [thread overview]
Message-ID: <20070826221927.740053374@sortiz.org> (raw)
In-Reply-To: 20070826221514.036436030@sortiz.org
[-- Attachment #1: irda_socket_msg_nosignal --]
[-- Type: text/plain, Size: 1819 bytes --]
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
net/irda/af_irda.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
Index: net-2.6.24-quilt/net/irda/af_irda.c
===================================================================
--- net-2.6.24-quilt.orig/net/irda/af_irda.c 2007-08-25 02:41:39.000000000 +0300
+++ net-2.6.24-quilt/net/irda/af_irda.c 2007-08-25 02:41:41.000000000 +0300
@@ -1245,18 +1245,17 @@
struct sock *sk = sock->sk;
struct irda_sock *self;
struct sk_buff *skb;
- int err;
+ int err = -EPIPE;
IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
- if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
+ if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR | MSG_CMSG_COMPAT |
+ MSG_NOSIGNAL))
return -EINVAL;
- if (sk->sk_shutdown & SEND_SHUTDOWN) {
- send_sig(SIGPIPE, current, 0);
- return -EPIPE;
- }
+ if (sk->sk_shutdown & SEND_SHUTDOWN)
+ goto out_err;
if (sk->sk_state != TCP_ESTABLISHED)
return -ENOTCONN;
@@ -1283,7 +1282,7 @@
skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16,
msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb)
- return -ENOBUFS;
+ goto out_err;
skb_reserve(skb, self->max_header_size + 16);
skb_reset_transport_header(skb);
@@ -1291,7 +1290,7 @@
err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
if (err) {
kfree_skb(skb);
- return err;
+ goto out_err;
}
/*
@@ -1301,10 +1300,14 @@
err = irttp_data_request(self->tsap, skb);
if (err) {
IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err);
- return err;
+ goto out_err;
}
/* Tell client how much data we actually sent */
return len;
+
+ out_err:
+ return sk_stream_error(sk, msg->msg_flags, err);
+
}
/*
--
next prev parent reply other threads:[~2007-08-26 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-26 22:15 [PATCH 0/3] [IrDA] IrDA updates for net-2.6.24 Samuel Ortiz
2007-08-26 22:15 ` Samuel Ortiz [this message]
2007-08-26 22:15 ` [PATCH 2/3] [IrDA] Kingsun Dazzle IrDA USB driver Samuel Ortiz
2007-08-26 22:15 ` [PATCH 3/3] [IrDA] Kingsun KS-959 " Samuel Ortiz
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=20070826221927.740053374@sortiz.org \
--to=samuel@sortiz.org \
--cc=davem@davemloft.net \
--cc=irda-users@lists.sourceforge.net \
--cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.