X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mon%2Fmons.c;h=cebe329b35491abbb9f47e918cdafc7f57d62418;hb=a0640fbfff65d0f9327f6e6bfadf40655f048136;hp=cb70d3b7767622044483ac70331fcf5fdade3454;hpb=fc7fb82d2661d977e7bacb4ffe469f3857a06b63;p=trust_router.git diff --git a/mon/mons.c b/mon/mons.c index cb70d3b..cebe329 100644 --- a/mon/mons.c +++ b/mon/mons.c @@ -237,13 +237,29 @@ int mons_accept(MONS_INSTANCE *mons, int listen) if (pid == 0) { close(listen); - tr_gss_handle_connection(conn, - "trustmonitor", mons->hostname, /* acceptor name */ - mons->auth_handler, mons->cookie, /* auth callback and cookie */ - mons_req_cb, mons /* req callback and cookie */ - ); + switch(tr_gss_handle_connection(conn, + "trustmonitor", mons->hostname, /* acceptor name */ + mons->auth_handler, mons->cookie, /* auth callback and cookie */ + mons_req_cb, mons /* req callback and cookie */ + )) { + case TR_GSS_SUCCESS: + /* do nothing */ + break; + + case TR_GSS_ERROR: + tr_debug("mons_accept: Error returned by tr_gss_handle_connection()"); + break; + + default: + tr_err("mons_accept: Unexpected value returned by tr_gss_handle_connection()"); + break; + } close(conn); - exit(0); /* exit to kill forked child process */ + + /* This ought to be an exit(0), but log4shib does not play well with our (mis)use of threads and + * fork() in the main process. Until we sort that out, we abort() to force termination of this + * process. */ + abort(); /* exit hard */ } /* Only the parent process gets here */