[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 28/87: term: improve the demuxer
From: |
Samuel Thibault |
Subject: |
[hurd] 28/87: term: improve the demuxer |
Date: |
Sun, 09 Nov 2014 11:05:01 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit d73b0ee5f32bdf769a5d9d19c4cc590df07c1bef
Author: Justus Winter <address@hidden>
Date: Tue Jun 10 14:49:46 2014 +0200
term: improve the demuxer
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.
* term/main.c (demuxer): Improve the demuxer function.
---
term/main.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/term/main.c b/term/main.c
index 9cc32d4..be014e1 100644
--- a/term/main.c
+++ b/term/main.c
@@ -32,6 +32,10 @@
#include <version.h>
+#include "term_S.h"
+#include "tioctl_S.h"
+#include "device_reply_S.h"
+
const char *argp_program_version = STANDARD_HURD_VERSION (term);
int trivfs_fstype = FSTYPE_TERM;
@@ -61,14 +65,18 @@ dev_t rdev;
int
demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
- extern int term_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int tioctl_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int device_reply_server (mach_msg_header_t *, mach_msg_header_t *);
-
- return (trivfs_demuxer (inp, outp)
- || term_server (inp, outp)
- || tioctl_server (inp, outp)
- || device_reply_server (inp, outp));
+ mig_routine_t routine;
+ if ((routine = NULL, trivfs_demuxer (inp, outp)) ||
+ (routine = term_server_routine (inp)) ||
+ (routine = tioctl_server_routine (inp)) ||
+ (routine = device_reply_server_routine (inp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
static struct argp_option options[] =
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (55dd7de -> e4a9a4d), Samuel Thibault, 2014/11/09
- [hurd] 15/87: tmpfs: use a thread timeout, Samuel Thibault, 2014/11/09
- [hurd] 19/87: libdiskfs: use correct type for disk offsets, Samuel Thibault, 2014/11/09
- [hurd] 26/87: Merge the random translator into the Hurd repository, Samuel Thibault, 2014/11/09
- [hurd] 22/87: ext2fs: use size_t where appropriate, Samuel Thibault, 2014/11/09
- [hurd] 14/87: Merge branch 'random' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into random, Samuel Thibault, 2014/11/09
- [hurd] 28/87: term: improve the demuxer,
Samuel Thibault <=
- [hurd] 27/87: Add the random translator to prog-subdirs, Samuel Thibault, 2014/11/09
- [hurd] 33/87: Merge procfs into the Hurd repository, Samuel Thibault, 2014/11/09
- [hurd] 34/87: Add the procfs translator to prog-subdirs, Samuel Thibault, 2014/11/09
- [hurd] 36/87: ftpfs: fix error handling in refresh_dir, Samuel Thibault, 2014/11/09
- [hurd] 29/87: hurd: fix receiver lookup in termctty_open_terminal, Samuel Thibault, 2014/11/09
- [hurd] 35/87: Add mach_debug defs rules, Samuel Thibault, 2014/11/09
- [hurd] 37/87: libshouldbeinlibc: fix dead initialization in fmt_named_interval, Samuel Thibault, 2014/11/09
- [hurd] 32/87: Prepare the procfs translator to be merged into the Hurd sources, Samuel Thibault, 2014/11/09
- [hurd] 38/87: trans/fakeroot: fix error handling, Samuel Thibault, 2014/11/09
- [hurd] 39/87: libports: avoid realloc(3) corner case, Samuel Thibault, 2014/11/09