From 1f1d1569f4bcd8acbfb80e0bdd11b752cdead637 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 18 Nov 2009 01:17:14 +0000 Subject: libglusterfsclient/ftruncate: add braces to ensure proper evaluation of if conditional. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 369 (Samba does not work with booster.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=369 --- libglusterfsclient/src/libglusterfsclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 1e50e004e8f..fb48fc300da 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5793,8 +5793,8 @@ libgf_client_ftruncate (libglusterfs_client_ctx_t *ctx, fd_t *fd, int op_ret = -1; libglusterfs_client_fd_ctx_t *fdctx = NULL; - if ((!(fd->flags & O_ACCMODE) == O_RDWR) - && (!((fd->flags & O_ACCMODE) == O_WRONLY))) { + if (!(((fd->flags & O_ACCMODE) == O_RDWR) + || ((fd->flags & O_ACCMODE) == O_WRONLY))) { errno = EBADF; goto out; } -- cgit