X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=tr%2Ftr_main.c;h=bb04bebf0841574771bcc2592b7ac38130fc5e2a;hp=3c74730f75f66ab3a1096d346e0022cf7fbed280;hb=58571ae4cf8f7492d383b81ae0f55c5283184ee4;hpb=c75a2def74110e1f6273326001c215ad0685c645 diff --git a/tr/tr_main.c b/tr/tr_main.c index 3c74730..bb04beb 100644 --- a/tr/tr_main.c +++ b/tr/tr_main.c @@ -146,15 +146,17 @@ static void configure_signals(void) } /* TODO move this function */ -static json_t *tr_mon_handle_version(void *cookie) +static MON_RC tr_mon_handle_version(void *cookie, json_t **result_ptr) { - return json_string(PACKAGE_VERSION); + *result_ptr = json_string(PACKAGE_VERSION); + return (*result_ptr == NULL) ? MON_NOMEM : MON_SUCCESS; } -static json_t *tr_mon_handle_uptime(void *cookie) +static MON_RC tr_mon_handle_uptime(void *cookie, json_t **result_ptr) { time_t *start_time = cookie; - return json_integer(time(NULL) - (*start_time)); + *result_ptr = json_integer(time(NULL) - (*start_time)); + return (*result_ptr == NULL) ? MON_NOMEM : MON_SUCCESS; } int main(int argc, char *argv[])