Skip to contentSkip to conversation

syscalls/getdents01: Add close() and open() at the end of run()

PATCH New zhaogongyi 1 participant 1 message Apr 25, 2021

lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

PATCH 1/1 syscalls/getdents01: Add close() and open() at the end of run()

Hi Cyril,

I have re-submitted the patch according you review, please see: https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Thanks so much!

Best Regards,
Gongyi

Quoted 26 lines

Hi!

Quoted 9 lines
 testcases/kernel/syscalls/getdents/getdents01.c | 3 +++
 1 file changed, 3 insertions(+)
testcases/kernel/syscalls/getdents/getdents01.c +0 -0
index ef8f4e864..7982691a6 100644

testcases/kernel/syscalls/getdents/getdents01.c static void run(void) · line 98

Quoted 7 lines
testcases/kernel/syscalls/getdents/getdents01.c +3 -0
@@ -92,6 +92,9 @@ static void run(void)
 	} while (rval > 0);
 
 	check_flags();
+
+	SAFE_CLOSE(fd);
+	fd = SAFE_OPEN(".", O_RDONLY|O_DIRECTORY);
 }

Good catch but I guess that it would be a bit cleaner if we opened the fd at the start of the run() and closed it at the end instead of opening it in setup() and reopening it for each iteration.

--
Cyril Hrubis
[email protected]