This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[PATCH] test-skeleton.c: Use stderr for error messages


At the moment a mixture of stderr and stdout is used for error
messages. Switch to using stderr for consistency.

ChangeLog:

2014-04-09  Will Newton  <will.newton@linaro.org>

	* test-skeleton.c (create_temp_file): Use stderr for
	outputting error messages.  (main): Likewise.
---
 test-skeleton.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test-skeleton.c b/test-skeleton.c
index d7d2f75..437c51d 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -110,7 +110,7 @@ create_temp_file (const char *base, char **filename)
 			   + sizeof ("XXXXXX"));
   if (fname == NULL)
     {
-      puts ("out of memory");
+      fputs ("out of memory", stderr);
       return -1;
     }
   strcpy (stpcpy (stpcpy (stpcpy (fname, test_dir), "/"), base), "XXXXXX");
@@ -118,7 +118,7 @@ create_temp_file (const char *base, char **filename)
   fd = mkstemp (fname);
   if (fd == -1)
     {
-      printf ("cannot open temporary file '%s': %m\n", fname);
+      fprintf (stderr, "cannot open temporary file '%s': %m\n", fname);
       free (fname);
       return -1;
     }
@@ -368,12 +368,12 @@ main (int argc, char *argv[])
   termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));
   if (termpid == -1)
     {
-      printf ("Waiting for test program failed: %m\n");
+      fprintf (stderr, "Waiting for test program failed: %m\n");
       exit (1);
     }
   if (termpid != pid)
     {
-      printf ("Oops, wrong test program terminated: expected %ld, got %ld\n",
+      fprintf (stderr, "Oops, wrong test program terminated: expected %ld, got %ld\n",
 	      (long int) pid, (long int) termpid);
       exit (1);
     }
-- 
1.8.1.4


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