From f6a532fbd0f430dc4ded254d713d89fcbafc1b7e Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Fri, 2 Jun 2023 17:28:11 +0200 Subject: tests: Replace various function calls with their x variant With fortification enabled, few function calls return result need to be checked, has they get the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar --- posix/tst-chmod.c | 7 +++++-- posix/wordexp-test.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'posix') diff --git a/posix/tst-chmod.c b/posix/tst-chmod.c index b98a05a265..470a696fe5 100644 --- a/posix/tst-chmod.c +++ b/posix/tst-chmod.c @@ -27,6 +27,8 @@ #include #include +#include + #define OUT_OF_MEMORY \ do { \ @@ -229,7 +231,8 @@ do_test (int argc, char *argv[]) close (fd); snprintf (buf, buflen, "%s/..", testdir); - chdir (buf); + xchdir (buf); + /* We are now in the directory above the one we create the test directory in. */ @@ -349,7 +352,7 @@ do_test (int argc, char *argv[]) } fail: - chdir (startdir); + xchdir (startdir); /* Remove all the files. */ chmod (testdir, 0700); diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c index 524597d96b..28d1d1509b 100644 --- a/posix/wordexp-test.c +++ b/posix/wordexp-test.c @@ -336,7 +336,7 @@ do_test (int argc, char *argv[]) if (cwd == NULL) cwd = ".."; - chdir (cwd); + xchdir (cwd); rmdir (tmpdir); return 0; -- cgit 1.4.1