summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-11-18 01:20:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-18 21:15:07 -0800
commited75d6588899b3a812818e82ac7805998dbbd5e0 (patch)
tree54998aa827b5b7cacef74d4e6f4cf030e8bdd37b /libglusterfsclient/src/libglusterfsclient.c
parent80f89493ce2d78095a2df64e48c7bd7291b4558d (diff)
libglusterfsclient/open: don't send create call if the file is already present, instead send open.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 369 (Samba does not work with booster.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=369
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 83943bd2a..93d9e3c2f 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -2949,6 +2949,10 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...)
goto out;
}
+ if (op_ret == 0) {
+ flags &= ~O_CREAT;
+ }
+
if ((op_ret == -1) && ((flags & O_CREAT) == O_CREAT)) {
libgf_client_loc_wipe (&loc);
loc.path = strdup (pathres);
@@ -2979,7 +2983,7 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...)
fd = fd_create (loc.inode, ctx->pid);
fd->flags = flags;
- if ((flags & O_CREAT) == O_CREAT) {
+ if (((flags & O_CREAT) == O_CREAT)) {
/* If we have the st_mode for the basename, check if
* it is a directory here itself, rather than sending
* a network message through libgf_client_creat, and