aboutsummaryrefslogtreecommitdiff
path: root/android/patches/0004-Remove-useless-open-mode.patch
blob: 6d86e0d1dfac0d879e5431bcffb8d1bdb862c19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 7edbca043da158b1335bc5cc010334244433db2f Mon Sep 17 00:00:00 2001
From: George Burgess IV <gbiv@google.com>
Date: Mon, 31 Jul 2017 13:55:52 -0700
Subject: [PATCH 04/24] Remove useless open mode

Open modes are ignored if the user doesn't want the file to be created:
http://man7.org/linux/man-pages/man2/open.2.html

Since it's somewhat misleading/potentially indicative of a missing
O_CREAT/O_TMPFILE, we plan to issue a warning on open calls with useless
mode bits in the near future. Because -Werror is used in this project
(thank you!), we need to either make the mode useful, or remove it.

(cherry picked from commit 0bba2e896d09c7ef7b49a409ba5cd869531befa9)
Bug: 64132680
Test: mma. New warning no longer appears.
---
 tools/testing/selftests/kcmp/kcmp_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c
index 6ea7b9f37a411..1ad60fce802d5 100644
--- a/tools/testing/selftests/kcmp/kcmp_test.c
+++ b/tools/testing/selftests/kcmp/kcmp_test.c
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
 		int pid2 = getpid();
 		int ret;
 
-		fd2 = open(kpath, O_RDWR, 0644);
+		fd2 = open(kpath, O_RDWR);
 		if (fd2 < 0) {
 			perror("Can't open file");
 			ksft_exit_fail();
-- 
2.36.0.550.gb090851708-goog