From 0ecd4e94a722d49b4dafbc995efad2b359b947d5 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 28 Mar 1996 20:17:04 +0000 Subject: (ports_manage_port_operations_one_thread): Fill in default reply before doing work; we might return 0 and mach_msg_server expects us to fill in a reply decently no matter what. (ports_manage_port_operations_multithread): Likewise. --- libports/manage-one-thread.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'libports/manage-one-thread.c') diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c index b3db18aa..254a3770 100644 --- a/libports/manage-one-thread.c +++ b/libports/manage-one-thread.c @@ -29,12 +29,33 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket, int internal_demuxer (mach_msg_header_t *inp, - mach_msg_header_t *outp) + mach_msg_header_t *outheadp) { struct port_info *pi; struct rpc_info link; int status; error_t err; + register mig_reply_header_t *outp = (mig_reply_header_t *) outheadp; + static const mach_msg_type_t RetCodeType = { + /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32, + /* msgt_size = */ 32, + /* msgt_number = */ 1, + /* msgt_inline = */ TRUE, + /* msgt_longform = */ FALSE, + /* msgt_deallocate = */ FALSE, + /* msgt_unused = */ 0 + }; + + /* Fill in default response. */ + outp->Head.msgh_bits + = MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(inp->msgh_bits), 0); + outp->Head.msgh_size = sizeof *outp; + outp->Head.msgh_remote_port = inp->msgh_remote_port; + outp->Head.msgh_local_port = MACH_PORT_NULL; + outp->Head.msgh_seqno = 0; + outp->Head.msgh_id = inp->msgh_id + 100; + outp->RetCodeType = RetCodeType; + outp->RetCode = MIG_BAD_ID; pi = ports_lookup_port (bucket, inp->msgh_local_port, 0); if (pi) @@ -50,7 +71,7 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket, /* No need to check cancel threshhold here, because in a single threaded server the cancel is always handled in order. */ - status = demuxer (inp, outp); + status = demuxer (inp, outheadp); ports_end_rpc (pi, &link); } ports_port_deref (pi); -- cgit v1.2.3