diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 22:32:38 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 22:32:38 +0000 |
commit | f5121bcba8cf12f2e61b3f0385ccf0851b3efe99 (patch) | |
tree | 352d0d042fb069f9d8559d9795e1a687305556f7 | |
parent | 3bd345b6cdf816728083eb666bbb854cdaa20131 (diff) | |
download | chromium_src-f5121bcba8cf12f2e61b3f0385ccf0851b3efe99.zip chromium_src-f5121bcba8cf12f2e61b3f0385ccf0851b3efe99.tar.gz chromium_src-f5121bcba8cf12f2e61b3f0385ccf0851b3efe99.tar.bz2 |
Fix a compile error in nacl_security_tests on some versions
of gcc.
Some versions of gcc give the following compilation error: /usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make: *** [out/Release/obj.target/nacl_security_tests/chrome/test/nacl_security_tests/commands_posix.o] Error 1
So provide a third argument (the permissions of the file if created).
Review URL: http://codereview.chromium.org/3046001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52765 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/nacl_security_tests/commands_posix.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/test/nacl_security_tests/commands_posix.cc b/chrome/test/nacl_security_tests/commands_posix.cc index 013043e..79bcde7 100644 --- a/chrome/test/nacl_security_tests/commands_posix.cc +++ b/chrome/test/nacl_security_tests/commands_posix.cc @@ -19,8 +19,11 @@ namespace sandbox { +// Permissions for the user to read & write and others to read. +const mode_t kCreatePermissions = 0644; + SboxTestResult TestOpenReadFile(const char *path) { - int fd = open(path, O_RDONLY | O_CREAT); + int fd = open(path, O_RDONLY | O_CREAT, kCreatePermissions); if (-1 == fd) { return SBOX_TEST_DENIED; } else { @@ -30,7 +33,7 @@ SboxTestResult TestOpenReadFile(const char *path) { } SboxTestResult TestOpenWriteFile(const char *path) { - int fd = open(path, O_WRONLY | O_CREAT); + int fd = open(path, O_WRONLY | O_CREAT, kCreatePermissions); if (-1 == fd) { return SBOX_TEST_DENIED; } else { |