[PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

From: Shuah Khan
Date: Thu Sep 04 2014 - 11:07:32 EST


mfd_fail_open() doesn't pass in the buffer to printf resulting
in the following warning:

memfd_test.c: In function âmfd_fail_openâ:
memfd_test.c:208:3: warning: format â%sâ expects a matching âchar *â argument [-Wformat=]
printf("open(%s) didn't fail as expected\n");
^

This change fixes the problem.

Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
---
tools/testing/selftests/memfd/memfd_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index cb5001b..0b9eafb 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -203,7 +203,7 @@ static void mfd_fail_open(int fd, int flags, mode_t mode)
sprintf(buf, "/proc/self/fd/%d", fd);
r = open(buf, flags, mode);
if (r >= 0) {
- printf("open(%s) didn't fail as expected\n");
+ printf("open(%s) didn't fail as expected\n", buf);
abort();
}
}
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/