diff options
| -rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 99129fc250a..9602492a625 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1574,7 +1574,9 @@ glusterfs_open (glusterfs_handle_t handle,          fd = fd_create (loc.inode, 0);          fd->flags = flags; -        if (!op_ret) { +        if ((flags & O_CREAT) == O_CREAT) +                op_ret = libgf_client_creat (ctx, &loc, fd, flags, mode); +        else {                  if (S_ISDIR (loc.inode->st_mode)) {                          if (((flags & O_RDONLY) == O_RDONLY) &&                               ((flags & O_WRONLY) == 0) &&  @@ -1589,9 +1591,6 @@ glusterfs_open (glusterfs_handle_t handle,                          op_ret = libgf_client_open (ctx, &loc, fd,                                                      flags);                  } -        } else { -                op_ret = libgf_client_creat (ctx, &loc, fd, flags, -                                             mode);          }          if (op_ret == -1) {  | 
