From: Mike Frysinger Date: Sun, 1 Mar 2015 08:11:35 +0000 (-0500) Subject: tests/getdents: handle older getdents calls X-Git-Tag: v4.10~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8dcf253fac7c951febc67c832a47e039d50aedc;p=strace tests/getdents: handle older getdents calls 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. --- diff --git a/tests/getdents.awk b/tests/getdents.awk index f9dc64dc..c230e267 100644 --- a/tests/getdents.awk +++ b/tests/getdents.awk @@ -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 "\\}"