Put more information about failed tests into the test return codes.
[gnulib.git] / m4 / d-ino.m4
index b019ae5..5261c10 100644 (file)
@@ -1,4 +1,4 @@
-# serial 11
+# serial 12
 
 dnl From Jim Meyering.
 dnl
@@ -27,12 +27,17 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
              if (! dp)
                return 1;
              e = readdir (dp);
-             return ! (e
-                       && stat (e->d_name, &st) == 0
-                       && e->d_ino == st.st_ino);]])],
-            [gl_cv_struct_dirent_d_ino=yes],
-            [gl_cv_struct_dirent_d_ino=no],
-            [gl_cv_struct_dirent_d_ino=no])])
+             if (! e)
+               return 2;
+             if (stat (e->d_name, &st) != 0)
+               return 3;
+             if (e->d_ino != st.st_ino)
+               return 4;
+             return 0;
+           ]])],
+           [gl_cv_struct_dirent_d_ino=yes],
+           [gl_cv_struct_dirent_d_ino=no],
+           [gl_cv_struct_dirent_d_ino=no])])
    if test $gl_cv_struct_dirent_d_ino = yes; then
      AC_DEFINE([D_INO_IN_DIRENT], [1],
        [Define if struct dirent has a member d_ino that actually works.])