소스 검색

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));
 }