浏览代码

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