summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 687caee6ab..a8bd974a3b 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2680,17 +2680,17 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
}
/* Should we atomically (to the client at least) truncate ? */
- if (!new_file_created) {
- if (flags2 & O_TRUNC) {
- if (!S_ISFIFO(fsp->fsp_name->st.st_ex_mode)) {
- int ret = vfs_set_filelen(fsp, 0);
- if (ret != 0) {
- status = map_nt_error_from_unix(errno);
- TALLOC_FREE(lck);
- fd_close(fsp);
- return status;
- }
- }
+ if ((!new_file_created) &&
+ (flags2 & O_TRUNC) &&
+ (!S_ISFIFO(fsp->fsp_name->st.st_ex_mode))) {
+ int ret;
+
+ ret = vfs_set_filelen(fsp, 0);
+ if (ret != 0) {
+ status = map_nt_error_from_unix(errno);
+ TALLOC_FREE(lck);
+ fd_close(fsp);
+ return status;
}
}