summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-19 05:32:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:14 -0500
commit48e1e45183270e2d56248c69e471bbcef816de08 (patch)
tree807bdad40c9d3e7aabbd42b838dbe7b8d5bae50b /source3
parentaddc07be7ddc0b82dd2aa7dbb07dd6277d3e4dc9 (diff)
downloadsamba-48e1e45183270e2d56248c69e471bbcef816de08.tar.gz
samba-48e1e45183270e2d56248c69e471bbcef816de08.tar.bz2
samba-48e1e45183270e2d56248c69e471bbcef816de08.zip
r17131: Optimisation - when doing a stat open don't open the
file unless we really have to (ie. O_CREAT and file doesn't exist). Jeremy. (This used to be commit 788aa15ea24e6dfb61820465b5b881829a64297a)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 53178956cd..4033243888 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -245,7 +245,7 @@ static NTSTATUS open_file(files_struct *fsp,
}
if ((access_mask & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) ||
- (local_flags & O_CREAT) ||
+ (!file_existed && (local_flags & O_CREAT)) ||
((local_flags & O_TRUNC) == O_TRUNC) ) {
/*