[LTP] [PATCH 1/1] nfs01_open_files: Fix pattern for deleted files
Petr Vorel
pvorel@suse.cz
Fri Mar 11 12:00:15 CET 2022
Fixes: 0989fe65f3 ("Corrected the export lines in nfs01 ...")
Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/network/nfs/nfs_stress/nfs01_open_files.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/testcases/network/nfs/nfs_stress/nfs01_open_files.c b/testcases/network/nfs/nfs_stress/nfs01_open_files.c
index 9342f11ba9..c5627058dc 100644
--- a/testcases/network/nfs/nfs_stress/nfs01_open_files.c
+++ b/testcases/network/nfs/nfs_stress/nfs01_open_files.c
@@ -10,7 +10,8 @@
#include <sys/stat.h>
#include <unistd.h>
-#define TEMPLATE "ltpXXXXXX"
+#define TEMPLATE_PREFIX "ltp"
+#define TEMPLATE TEMPLATE_PREFIX "XXXXXX"
int write_something(int);
void delete_files(void);
@@ -101,7 +102,7 @@ void delete_files(void)
dirp = opendir(".");
for (entp = readdir(dirp); entp; entp = readdir(dirp))
- if (!strncmp(entp->d_name, "apt", 3)) {
+ if (!strncmp(entp->d_name, TEMPLATE_PREFIX, 3)) {
if (stat(entp->d_name, &stat_buffer))
abortx("stat() failed for \"%s\", errno = %d",
entp->d_name, errno);
--
2.35.1
More information about the ltp
mailing list