X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=tid%2Ftids.c;h=e780a22b69d99dfa11f2dfef689c3c23c7ba56e5;hb=fc7fb82d2661d977e7bacb4ffe469f3857a06b63;hp=a11f48b09c00d2bc48788bfaad46d8e60504471b;hpb=db9d1e5d3aae0894d46efff7d4f6d5fcfb160570;p=trust_router.git diff --git a/tid/tids.c b/tid/tids.c index a11f48b..e780a22 100644 --- a/tid/tids.c +++ b/tid/tids.c @@ -399,8 +399,8 @@ int tids_accept(TIDS_INSTANCE *tids, int listen) int pipe_fd[2]; struct tid_process tp = {0}; - if (0 > (conn = accept(listen, NULL, NULL))) { - perror("Error from TIDS Server accept()"); + if (0 > (conn = tr_sock_accept(listen))) { + tr_err("tids_accept: Error accepting connection"); return 1; } @@ -442,6 +442,17 @@ int tids_accept(TIDS_INSTANCE *tids, int listen) return 0; } +/** + * Clean up any finished TID request processes + * + * This is called by the main process after forking each TID request. If you want to be + * sure finished processes are cleaned up promptly even during a lull in TID requests, + * this can be called from the main thread of the main process. It is not thread-safe, + * so should not be used from sub-threads. It should not be called by child processes - + * this would probably be harmless but ineffective. + * + * @param tids + */ void tids_sweep_procs(TIDS_INSTANCE *tids) { guint ii;