X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=mon%2Fmons.c;h=b0a04003bed9ac71b0b8316d6200d52e15805547;hp=f2e69c540f5f7d8e680d52b89f4b975e212445be;hb=7458d6a285fa526fd8cec03e1bbb497650a0e405;hpb=3c5fb17459ff56d5e23cea059503f46a42150a1e diff --git a/mon/mons.c b/mon/mons.c index f2e69c5..b0a0400 100644 --- a/mon/mons.c +++ b/mon/mons.c @@ -225,8 +225,8 @@ int mons_accept(MONS_INSTANCE *mons, int listen) int conn=-1; int pid=-1; - if (0 > (conn = accept(listen, NULL, NULL))) { - perror("Error from monitoring interface accept()"); + if (0 > (conn = tr_sock_accept(listen))) { + tr_err("mons_accept: Error accepting connection"); return 1; } @@ -237,11 +237,23 @@ 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 */ }