Browse Source

dont use %m glibcism

Mike Frysinger 18 years ago
parent
commit
09c9327657
3 changed files with 6 additions and 4 deletions
  1. 3 1
      test/misc/sem.c
  2. 1 1
      test/string/stratcliff.c
  3. 2 2
      test/test-skeleton.c

+ 3 - 1
test/misc/sem.c

@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -18,7 +20,7 @@ int main(void)
 	printf("semget(IPC_CREAT) = %d\n", k);
 
 	if (k < 0) {
-		fprintf(stderr, "semget failed: %m\n");
+		fprintf(stderr, "semget failed: %s\n", strerror(errno));
 		return 1;
 	}
 

+ 1 - 1
test/string/stratcliff.c

@@ -52,7 +52,7 @@ main (int argc, char *argv[])
         puts ("No test, mmap not available.");
       else
         {
-          printf ("mmap failed: %m");
+          printf ("mmap failed: %s", strerror(errno));
           result = 1;
         }
     }

+ 2 - 2
test/test-skeleton.c

@@ -117,7 +117,7 @@ create_temp_file (const char *base, char **filename)
   fd = mkstemp (fname);
   if (fd == -1)
     {
-      printf ("cannot open temporary file '%s': %m\n", fname);
+      printf ("cannot open temporary file '%s': %s\n", fname, strerror(errno));
       free (fname);
       return -1;
     }
@@ -335,7 +335,7 @@ main (int argc, char *argv[])
   termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));
   if (termpid == -1)
     {
-      printf ("Waiting for test program failed: %m\n");
+      printf ("Waiting for test program failed: %s\n", strerror(errno));
       exit (1);
     }
   if (termpid != pid)