commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 03/12: eth-multiplexer: improve the netfs_demuxer function


From: Samuel Thibault
Subject: [hurd] 03/12: eth-multiplexer: improve the netfs_demuxer function
Date: Wed, 10 Dec 2014 15:16:58 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit db98832d3ee1743ef2f39f3aabc1636b277e5a20
Author: Justus Winter <address@hidden>
Date:   Fri Nov 14 18:31:54 2014 +0100

    eth-multiplexer: improve the netfs_demuxer function
    
    Handle multiple request types as recommended by the Mach Server
    Writer's Guide section 4, subsection "Handling Multiple Request
    Types".  This avoids initializing the reply message in every X_server
    function.  The reply message has already been properly initialized in
    libports, so there is no need to call mig_reply_setup.
    
    * eth-multiplexer/demuxer.c (netfs_demuxer): Improve the demuxer
    function.
---
 eth-multiplexer/demuxer.c | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eth-multiplexer/demuxer.c b/eth-multiplexer/demuxer.c
index 1f671b2..68bf968 100644
--- a/eth-multiplexer/demuxer.c
+++ b/eth-multiplexer/demuxer.c
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2013 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -20,22 +20,31 @@
 
 #include <hurd/netfs.h>
 
+#include "libnetfs/io_S.h"
+#include "libnetfs/fs_S.h"
+#include "libports/notify_S.h"
+#include "libnetfs/fsys_S.h"
+#include "libports/interrupt_S.h"
+#include "libnetfs/ifsock_S.h"
+#include "device_S.h"
+
 int
 netfs_demuxer (mach_msg_header_t *inp,
               mach_msg_header_t *outp)
 {
-  int netfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
-  int netfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
-  int netfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
-  int netfs_ifsock_server (mach_msg_header_t *, mach_msg_header_t *);
-  int device_server (mach_msg_header_t *, mach_msg_header_t *);
-
-  return (netfs_io_server (inp, outp)
-          || netfs_fs_server (inp, outp)
-          || ports_notify_server (inp, outp)
-          || netfs_fsys_server (inp, outp)
-          || ports_interrupt_server (inp, outp)
-          || netfs_ifsock_server (inp, outp)
-         || device_server (inp, outp));
+  mig_routine_t routine;
+  if ((routine = netfs_io_server_routine (inp)) ||
+      (routine = netfs_fs_server_routine (inp)) ||
+      (routine = ports_notify_server_routine (inp)) ||
+      (routine = netfs_fsys_server_routine (inp)) ||
+      (routine = ports_interrupt_server_routine (inp)) ||
+      (routine = netfs_ifsock_server_routine (inp)) ||
+      (routine = device_server_routine (inp)))
+    {
+      (*routine) (inp, outp);
+      return TRUE;
+    }
+  else
+    return FALSE;
 }
 

-- 
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]