From 48e1e45183270e2d56248c69e471bbcef816de08 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 19 Jul 2006 05:32:12 +0000 Subject: 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) --- source3/smbd/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) ) { /* -- cgit