Add missing parameter to open(path, flags) call in CreateEmptyFile in blaze_util_test. According to the man page of open, when O_CREAT is specified in flags then an extra parameter (t_mode mode) must be present too.
--
MOS_MIGRATED_REVID=137314830
diff --git a/src/test/cpp/blaze_util_test.cc b/src/test/cpp/blaze_util_test.cc
index 72eaaaa..ae3d173 100644
--- a/src/test/cpp/blaze_util_test.cc
+++ b/src/test/cpp/blaze_util_test.cc
@@ -33,7 +33,13 @@
}
static bool CreateEmptyFile(const string& path) {
- int fd = open(path.c_str(), O_CREAT | O_WRONLY);
+ // From the man page of open (man 2 open):
+ // int open(const char *pathname, int flags, mode_t mode);
+ //
+ // mode specifies the permissions to use in case a new file is created.
+ // This argument must be supplied when O_CREAT is specified in flags;
+ // if O_CREAT is not specified, then mode is ignored.
+ int fd = open(path.c_str(), O_CREAT | O_WRONLY, 0700);
if (fd == -1) {
return false;
}