commit-hurd
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]