[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 18/19: Support MSG_DONTWAIT in pflocal send/recv
From: |
Samuel Thibault |
Subject: |
[hurd] 18/19: Support MSG_DONTWAIT in pflocal send/recv |
Date: |
Wed, 10 Aug 2016 00:05:51 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit c8c973750b949f8c4fcac020c61a3b99e5d5c3a2
Author: Christian Seiler <address@hidden>
Date: Tue Aug 9 01:49:49 2016 +0200
Support MSG_DONTWAIT in pflocal send/recv
* pflocal/socket.c (S_socket_send): Also test for MSG_DONTWAIT in `flags'
for the `noblock' parameter of pipe_send call.
(S_socket_recv): Likewise for pipe_recv call.
---
pflocal/socket.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/pflocal/socket.c b/pflocal/socket.c
index f2b75a7..0fcf484 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -282,6 +282,7 @@ S_socket_send (struct sock_user *user, struct addr
*dest_addr, int flags,
size_t *amount)
{
error_t err = 0;
+ int noblock;
struct pipe *pipe;
struct sock *sock, *dest_sock;
struct addr *source_addr;
@@ -333,8 +334,9 @@ S_socket_send (struct sock_user *user, struct addr
*dest_addr, int flags,
if (!err)
{
- err = pipe_send (pipe, sock->flags & PFLOCAL_SOCK_NONBLOCK,
- source_addr, data, data_len,
+ noblock = (user->sock->flags & PFLOCAL_SOCK_NONBLOCK)
+ || (flags & MSG_DONTWAIT);
+ err = pipe_send (pipe, noblock, source_addr, data, data_len,
control, control_len, ports, num_ports,
amount);
if (dest_sock)
@@ -373,6 +375,7 @@ S_socket_recv (struct sock_user *user,
{
error_t err;
unsigned flags;
+ int noblock;
struct pipe *pipe;
void *source_addr = NULL;
@@ -398,10 +401,11 @@ S_socket_recv (struct sock_user *user,
}
else if (!err)
{
+ noblock = (user->sock->flags & PFLOCAL_SOCK_NONBLOCK)
+ || (in_flags & MSG_DONTWAIT);
err =
- pipe_recv (pipe, user->sock->flags & PFLOCAL_SOCK_NONBLOCK, &flags,
- &source_addr, data, data_len, amount,
- control, control_len, ports, num_ports);
+ pipe_recv (pipe, noblock, &flags, &source_addr, data, data_len,
+ amount, control, control_len, ports, num_ports);
pipe_release_reader (pipe);
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (04cfa52 -> 02f5c02), Samuel Thibault, 2016/08/09
- [hurd] 18/19: Support MSG_DONTWAIT in pflocal send/recv,
Samuel Thibault <=
- [hurd] 19/19: trans/crash: core file name templates, Samuel Thibault, 2016/08/09
- [hurd] 05/19: Revert "drop the deprecated malloc/free hooks in hurd/mach-defpager", Samuel Thibault, 2016/08/09
- [hurd] 09/19: trans/crash: fix resource leaks, Samuel Thibault, 2016/08/09
- [hurd] 06/19: Complete allocation hooks, Samuel Thibault, 2016/08/09
- [hurd] 12/19: pfinet: fix memory leak, Samuel Thibault, 2016/08/09
- [hurd] 13/19: proc: Fix references to the startup server., Samuel Thibault, 2016/08/09
- [hurd] 02/19: ext2fs: fix pager use-after-free, Samuel Thibault, 2016/08/09
- [hurd] 01/19: libdiskfs: fix error handling, Samuel Thibault, 2016/08/09
- [hurd] 07/19: Fix pipe_send() with no data, Samuel Thibault, 2016/08/09
- [hurd] 11/19: trans/crash: fix blunder, Samuel Thibault, 2016/08/09