You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by hu...@apache.org on 2016/11/03 08:24:19 UTC
incubator-hawq git commit: HAWQ-1143. Libhdfs create semantic is not
consistent with posix standard.
Repository: incubator-hawq
Updated Branches:
refs/heads/master b2c14cfc6 -> 68867d781
HAWQ-1143. Libhdfs create semantic is not consistent with posix standard.
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/68867d78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/68867d78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/68867d78
Branch: refs/heads/master
Commit: 68867d781e138b0504145ef65c73b0d996fe5216
Parents: b2c14cf
Author: hzhang2 <zh...@163.com>
Authored: Thu Nov 3 16:21:24 2016 +0800
Committer: hzhang2 <zh...@163.com>
Committed: Thu Nov 3 16:21:24 2016 +0800
----------------------------------------------------------------------
depends/libhdfs3/src/client/Hdfs.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/68867d78/depends/libhdfs3/src/client/Hdfs.cpp
----------------------------------------------------------------------
diff --git a/depends/libhdfs3/src/client/Hdfs.cpp b/depends/libhdfs3/src/client/Hdfs.cpp
index cafb289..9906a87 100644
--- a/depends/libhdfs3/src/client/Hdfs.cpp
+++ b/depends/libhdfs3/src/client/Hdfs.cpp
@@ -646,9 +646,9 @@ hdfsFile hdfsOpenFile(hdfsFS fs, const char * path, int flags, int bufferSize,
if ((flags & O_CREAT) || (flags & O_APPEND) || (flags & O_WRONLY)) {
int internalFlags = 0;
- if (flags & O_CREAT) {
+ if ((flags & O_CREAT) && (flags & O_EXCL)) {
internalFlags |= Hdfs::Create;
- } else if ((flags & O_APPEND) && (flags & O_WRONLY)) {
+ } else if ((flags & O_CREAT) || ((flags & O_APPEND) && (flags & O_WRONLY))) {
internalFlags |= Hdfs::Create;
internalFlags |= Hdfs::Append;
} else if (flags & O_WRONLY) {