From 10148a1a4bd07eda84e8a3ccfb006bc5231c8350 Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 21 Jul 2007 20:46:08 +0000 Subject: [PATCH] ressurrected the srfsh time command git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1054 9efc2488-bf62-4759-914b-345cdb29e865 --- src/srfsh/srfsh.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c index e546681..72f40b1 100644 --- a/src/srfsh/srfsh.c +++ b/src/srfsh/srfsh.c @@ -47,7 +47,7 @@ static int parse_request( char* request ); static int handle_router( char* words[] ); /* utility method for print time data */ -/* static int handle_time( char* words[] ); */ +static int handle_time( char* words[] ); /* handles app level requests */ static int handle_request( char* words[], int relay ); @@ -265,10 +265,8 @@ static int parse_request( char* request ) { if( !strcmp(words[0],"router") ) ret_val = handle_router( words ); - /* else if( !strcmp(words[0],"time") ) ret_val = handle_time( words ); - */ else if (!strcmp(words[0],"request")) ret_val = handle_request( words, 0 ); @@ -683,30 +681,15 @@ int send_request( char* server, } -/* static int handle_time( char* words[] ) { - - if( ! words[1] ) { - - char buf[36]; - memset(buf,0,36); - get_timestamp(buf); - printf( "%s\n", buf ); - return 1; - } - - if( words[1] ) { - time_t epoch = (time_t)atoi( words[1] ); - char* localtime = strdup( ctime( &epoch ) ); - printf( "%s => %s", words[1], localtime ); - free(localtime); - return 1; - } - - return 0; - + if(!words[1]) { + printf("%f\n", get_timestamp_millis()); + } else { + time_t epoch = (time_t) atoi(words[1]); + printf("%s", ctime(&epoch)); + } + return 1; } -*/ -- 2.11.0