diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-10-24 17:32:30 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-10-24 17:32:30 +0000 |
commit | c95514dfc454161d9a0590c2a9c6a735c56bacc0 (patch) | |
tree | 415d577d0f6514779cccb6b44b418dfaba197550 | |
parent | 664c464f9aa60c93a0bc7942579fbf6255c38c71 (diff) |
(ports_manage_port_operations_one_thread/internal_demuxer): Don't
attempt RPC if we can't get a valid port struct.
-rw-r--r-- | libports/manage-one-thread.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c index 41cf4b70..0fd4f67a 100644 --- a/libports/manage-one-thread.c +++ b/libports/manage-one-thread.c @@ -37,19 +37,23 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket, error_t err; pi = ports_lookup_port (bucket, inp->msgh_local_port, 0); - err = ports_begin_rpc (pi, &link); - if (err) + if (pi) { - mach_port_deallocate (mach_task_self (), inp->msgh_remote_port); - status = 0; + err = ports_begin_rpc (pi, &link); + if (err) + { + mach_port_deallocate (mach_task_self (), inp->msgh_remote_port); + status = 0; + } + else + { + status = demuxer (inp, outp); + ports_end_rpc (pi, &link); + } + ports_port_deref (pi); } else - { - status = demuxer (inp, outp); - ports_end_rpc (pi, &link); - } - - ports_port_deref (pi); + status = 0; return status; } |