[PATCH 15/22] shell: Print to stderr in TIME command

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 18 14:37:21 UTC 2014


---
 cpukit/libmisc/shell/main_time.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/libmisc/shell/main_time.c b/cpukit/libmisc/shell/main_time.c
index dadcd85..e574647 100644
--- a/cpukit/libmisc/shell/main_time.c
+++ b/cpukit/libmisc/shell/main_time.c
@@ -49,7 +49,7 @@ static int rtems_shell_main_time(
 
   sc = rtems_clock_get_uptime(&start);
   if (sc != RTEMS_SUCCESSFUL)
-    printf("error: cannot read time\n");
+    fprintf(stderr, "error: cannot read time\n");
 
   if (argc) {
     shell_cmd = rtems_shell_lookup_cmd(argv[1]);
@@ -64,7 +64,7 @@ static int rtems_shell_main_time(
 
   sc = rtems_clock_get_uptime(&end);
   if (sc != RTEMS_SUCCESSFUL)
-    printf("error: cannot read time\n");
+    fprintf(stderr, "error: cannot read time\n");
 
   period.tv_sec = end.tv_sec - start.tv_sec;
   period.tv_nsec = end.tv_nsec - start.tv_nsec;
@@ -74,7 +74,7 @@ static int rtems_shell_main_time(
     period.tv_nsec += 1000000000UL;
   }
 
-  printf("time: %" PRIdtime_t ":%02" PRIdtime_t ":%02" PRIdtime_t ".%03li\n",
+  fprintf(stderr, "time: %" PRIdtime_t ":%02" PRIdtime_t ":%02" PRIdtime_t ".%03li\n",
          period.tv_sec / 3600,
          period.tv_sec / 60, period.tv_sec % 60,
          period.tv_nsec / 1000000);
-- 
1.8.4.5



More information about the devel mailing list