This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: FWD: SNTP client package
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Cc: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 25 Feb 2003 09:08:09 -0700
- Subject: Re: FWD: SNTP client package
- References: <20030225094253.GA11159@biferten.ma.tech.ascom.ch><1046181499.21674.2070.camel@hermes.chez-thomas.org> <20030225143038.GA14575@biferten.ma.tech.ascom.ch>
I've tested this on a big-endian (PowerPC) system and it works fine.
My only comment (beyond Jonathan's ever vigilant list :-) would be
that the INFO line in the test contains an extra \n. This patch
makes it much more readable:
Index: net/sntp/current/tests/sntp1.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/sntp/current/tests/sntp1.c,v
retrieving revision 1.1
diff -u -5 -p -b -r1.1 sntp1.c
--- net/sntp/current/tests/sntp1.c 25 Feb 2003 14:42:22 -0000 1.1
+++ net/sntp/current/tests/sntp1.c 25 Feb 2003 16:03:30 -0000
@@ -67,10 +67,11 @@ net_test(cyg_addrword_t param)
char month[4];
char months[12][4] = { "Jan", "Feb", "Mar",
"Apr", "May", "Jun",
"Jul", "Aug", "Sep",
"Oct", "Nov", "Dec" };
+ char time_info[32];
CYG_TEST_INIT();
CYG_TEST_INFO("sntp1 test build " __DATE__);
@@ -78,11 +79,13 @@ net_test(cyg_addrword_t param)
cyg_sntp_start();
for (seconds = 120; seconds > 0; seconds--) {
now = time(NULL);
- CYG_TEST_INFO(ctime(&now));
+ ctime_r(&now, time_info);
+ time_info[strlen(time_info)-1] = '\0'; // Strip \n
+ CYG_TEST_INFO(time_info);
cyg_thread_delay(100);
}
now = time(NULL);
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary at mlbassoc dot com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------