Преглед изворни кода

Add strerror to error test

Jeremy Soller пре 7 година
родитељ
комит
1127c36ceb
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      tests/error.c

+ 3 - 2
tests/error.c

@@ -1,8 +1,9 @@
 #include <unistd.h>
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 
 int main(int argc, char** argv) {
-    chdir("nonexistent"); 
-    printf("errno: %d\n", errno);
+    chdir("nonexistent");
+    printf("errno: %d = %s\n", errno, strerror(errno));
 }