]> granicus.if.org Git - strace/commitdiff
tests/getdents: handle older getdents calls
authorMike Frysinger <vapier@gentoo.org>
Sun, 1 Mar 2015 08:11:35 +0000 (03:11 -0500)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 1 Mar 2015 21:42:08 +0000 (21:42 +0000)
If the tools we use call older getdents syscalls where d_type isn't
passed back, or the arch is old (like Alpha) and can't pass back in
either version, make sure we don't fail.

* tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN.

tests/getdents.awk

index f9dc64dcecda273fdab5354a02af132c7f27f5ad..c230e26734b34c3bda1cdb366f20f691e4d61274 100644 (file)
@@ -11,8 +11,9 @@ BEGIN {
   d_name_1 = "d_name=\"\\.\""
   d_name_2 = "d_name=\"\\.\\.\""
   d_name_3 = "d_name=\"(A\\\\n){127}Z\""
-  d_type_dir = "d_type=DT_DIR"
-  d_type_reg = "d_type=DT_REG"
+  # Some older systems might not pass back d_type at all like Alpha.
+  d_type_dir = "d_type=DT_(DIR|UNKNOWN)"
+  d_type_reg = "d_type=DT_(REG|UNKNOWN)"
 
   dirent_1   = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name_1 ", " d_type_dir "\\}"
   dirent_2   = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name_2 ", " d_type_dir "\\}"