This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FWD: SNTP client package


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
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]