summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch')
-rw-r--r--meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch b/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch
new file mode 100644
index 0000000000..99497d655a
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0037-faccessat-and-fchmodat-Fix-build-warnings.patch
@@ -0,0 +1,68 @@
1From 4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647 Mon Sep 17 00:00:00 2001
2From: Naresh Kamboju <naresh.kamboju@linaro.org>
3Date: Mon, 19 Jun 2017 19:01:21 +0530
4Subject: [PATCH 1/7] faccessat and fchmodat: Fix build warnings
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Fixing below build warnings.
10
11ltp-full-20170516/testcases/kernel/syscalls/faccessat$ make
12In file included from ../../../../include/old/test.h:51:0,
13 from faccessat01.c:44:
14faccessat01.c: In function ‘setup’:
15../../../../include/old/old_safe_file_ops.h:55:27:
16warning: format not a string literal and no format arguments [-Wformat-security]
17 (path), (fmt), ## __VA_ARGS__)
18 ^
19faccessat01.c:132:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
20 SAFE_FILE_PRINTF(cleanup, testfile, testfile);
21 ^
22../../../../include/old/old_safe_file_ops.h:55:27:
23warning: format not a string literal and no format arguments [-Wformat-security]
24 (path), (fmt), ## __VA_ARGS__)
25 ^
26faccessat01.c:133:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
27 SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
28
29Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
30Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647]
31---
32 testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
33 testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++--
34 2 files changed, 4 insertions(+), 4 deletions(-)
35
36diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
37index 622dfd3b0..def7fa755 100644
38--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
39+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
40@@ -129,8 +129,8 @@ void setup(void)
41 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
42 fds[1] = fds[4] = fds[0];
43
44- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
45- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
46+ SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
47+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
48
49 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
50
51diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
52index 6bf66d8b8..7856ed3fa 100644
53--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
54+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
55@@ -127,8 +127,8 @@ void setup(void)
56 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
57 fds[1] = fds[4] = fds[0];
58
59- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
60- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
61+ SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
62+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
63
64 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
65 fds[3] = 100;
66--
672.13.0
68