Blame SOURCES/glibc-rh1418978-3-1.patch

147e83
commit c5c13355132e73578bbc0c612ddff964e6199747
147e83
Author: Will Newton <will.newton@linaro.org>
147e83
Date:   Fri Apr 11 15:21:23 2014 +0100
147e83
147e83
    test-skeleton.c: Use stdout for error messages
147e83
    
147e83
    At the moment the test skeleton uses a mixture of stdout and
147e83
    stderr for error message output. Using stdout for all test output
147e83
    keeps all output correctly ordered and properly redirected to the
147e83
    output file. The suggestion to use stdout is also made on the wiki:
147e83
    
147e83
    https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case
147e83
    
147e83
    ChangeLog:
147e83
    
147e83
    2014-06-23  Will Newton  <will.newton@linaro.org>
147e83
    
147e83
            * test-skeleton.c (signal_handler): Use printf and %m
147e83
            rather than perror.  Use printf rather than fprintf to
147e83
            stderr.  Use puts rather than fputs to stderr.
147e83
            (main): Likewise.
147e83
147e83
Index: b/test-skeleton.c
147e83
===================================================================
147e83
--- a/test-skeleton.c
147e83
+++ b/test-skeleton.c
147e83
@@ -188,7 +188,7 @@ signal_handler (int sig __attribute__ ((
147e83
     }
147e83
   if (killed != 0 && killed != pid)
147e83
     {
147e83
-      perror ("Failed to kill test process");
147e83
+      printf ("Failed to kill test process: %m\n");
147e83
       exit (1);
147e83
     }
147e83
 
147e83
@@ -209,16 +209,16 @@ signal_handler (int sig __attribute__ ((
147e83
 #endif
147e83
 
147e83
   if (killed == 0 || (WIFSIGNALED (status) && WTERMSIG (status) == SIGKILL))
147e83
-    fputs ("Timed out: killed the child process\n", stderr);
147e83
+    puts ("Timed out: killed the child process");
147e83
   else if (WIFSTOPPED (status))
147e83
-    fprintf (stderr, "Timed out: the child process was %s\n",
147e83
-	     strsignal (WSTOPSIG (status)));
147e83
+    printf ("Timed out: the child process was %s\n",
147e83
+	    strsignal (WSTOPSIG (status)));
147e83
   else if (WIFSIGNALED (status))
147e83
-    fprintf (stderr, "Timed out: the child process got signal %s\n",
147e83
-	     strsignal (WTERMSIG (status)));
147e83
+    printf ("Timed out: the child process got signal %s\n",
147e83
+	    strsignal (WTERMSIG (status)));
147e83
   else
147e83
-    fprintf (stderr, "Timed out: killed the child process but it exited %d\n",
147e83
-	     WEXITSTATUS (status));
147e83
+    printf ("Timed out: killed the child process but it exited %d\n",
147e83
+	    WEXITSTATUS (status));
147e83
 
147e83
   /* Exit with an error.  */
147e83
   exit (1);
147e83
@@ -308,7 +308,7 @@ main (int argc, char *argv[])
147e83
 
147e83
       if (chdir (test_dir) < 0)
147e83
 	{
147e83
-	  perror ("chdir");
147e83
+	  printf ("chdir: %m\n");
147e83
 	  exit (1);
147e83
 	}
147e83
     }
147e83
@@ -367,10 +367,10 @@ main (int argc, char *argv[])
147e83
 	    data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT,
147e83
 				       data_limit.rlim_max);
147e83
 	  if (setrlimit (RLIMIT_DATA, &data_limit) < 0)
147e83
-	    perror ("setrlimit: RLIMIT_DATA");
147e83
+	    printf ("setrlimit: RLIMIT_DATA: %m\n");
147e83
 	}
147e83
       else
147e83
-	perror ("getrlimit: RLIMIT_DATA");
147e83
+	printf ("getrlimit: RLIMIT_DATA: %m\n");
147e83
 #endif
147e83
 
147e83
       /* We put the test process in its own pgrp so that if it bogusly
147e83
@@ -382,7 +382,7 @@ main (int argc, char *argv[])
147e83
     }
147e83
   else if (pid < 0)
147e83
     {
147e83
-      perror ("Cannot fork test program");
147e83
+      printf ("Cannot fork test program: %m\n");
147e83
       exit (1);
147e83
     }
147e83
 
147e83
@@ -420,18 +420,16 @@ main (int argc, char *argv[])
147e83
       if (EXPECTED_SIGNAL != 0)
147e83
 	{
147e83
 	  if (WTERMSIG (status) == 0)
147e83
-	    fprintf (stderr,
147e83
-		     "Expected signal '%s' from child, got none\n",
147e83
-		     strsignal (EXPECTED_SIGNAL));
147e83
+	    printf ("Expected signal '%s' from child, got none\n",
147e83
+		    strsignal (EXPECTED_SIGNAL));
147e83
 	  else
147e83
-	    fprintf (stderr,
147e83
-		     "Incorrect signal from child: got `%s', need `%s'\n",
147e83
-		     strsignal (WTERMSIG (status)),
147e83
-		     strsignal (EXPECTED_SIGNAL));
147e83
+	    printf ("Incorrect signal from child: got `%s', need `%s'\n",
147e83
+		    strsignal (WTERMSIG (status)),
147e83
+		    strsignal (EXPECTED_SIGNAL));
147e83
 	}
147e83
       else
147e83
-	fprintf (stderr, "Didn't expect signal from child: got `%s'\n",
147e83
-		 strsignal (WTERMSIG (status)));
147e83
+	printf ("Didn't expect signal from child: got `%s'\n",
147e83
+		strsignal (WTERMSIG (status)));
147e83
       exit (1);
147e83
     }
147e83
 
147e83
@@ -441,8 +439,8 @@ main (int argc, char *argv[])
147e83
 #else
147e83
   if (WEXITSTATUS (status) != EXPECTED_STATUS)
147e83
     {
147e83
-      fprintf (stderr, "Expected status %d, got %d\n",
147e83
-	       EXPECTED_STATUS, WEXITSTATUS (status));
147e83
+      printf ("Expected status %d, got %d\n",
147e83
+	      EXPECTED_STATUS, WEXITSTATUS (status));
147e83
       exit (1);
147e83
     }
147e83