From f79fb4429c7fb9c2ae81f06fc8f2162a1ccd226c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 17 Jul 2012 21:52:13 +0200 Subject: s3: Slightly simplify reply_close() Signed-off-by: Jeremy Allison --- source3/smbd/reply.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 03af4ac403..954938cbe3 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -4812,10 +4812,6 @@ void reply_exit(struct smb_request *req) return; } -/**************************************************************************** - Reply to a close - has to deal with closing a directory opened by NT SMB's. -****************************************************************************/ - void reply_close(struct smb_request *req) { connection_struct *conn = req->conn; @@ -4841,21 +4837,13 @@ void reply_close(struct smb_request *req) return; } - if(fsp->is_directory) { - /* - * Special case - close NT SMB directory handle. - */ - DEBUG(3,("close directory %s\n", fsp_fnum_dbg(fsp))); - status = close_file(req, fsp, NORMAL_CLOSE); - } else { - time_t t; - /* - * Close ordinary file. - */ + DEBUG(3, ("Close %s fd=%d %s (numopen=%d)\n", + fsp->is_directory ? "directory" : "file", + fsp->fh->fd, fsp_fnum_dbg(fsp), + conn->num_files_open)); - DEBUG(3,("close fd=%d %s (numopen=%d)\n", - fsp->fh->fd, fsp_fnum_dbg(fsp), - conn->num_files_open)); + if (!fsp->is_directory) { + time_t t; /* * Take care of any time sent in the close. @@ -4863,15 +4851,15 @@ void reply_close(struct smb_request *req) t = srv_make_unix_date3(req->vwv+1); set_close_write_time(fsp, convert_time_t_to_timespec(t)); + } - /* - * close_file() returns the unix errno if an error - * was detected on close - normally this is due to - * a disk full error. If not then it was probably an I/O error. - */ + /* + * close_file() returns the unix errno if an error was detected on + * close - normally this is due to a disk full error. If not then it + * was probably an I/O error. + */ - status = close_file(req, fsp, NORMAL_CLOSE); - } + status = close_file(req, fsp, NORMAL_CLOSE); if (!NT_STATUS_IS_OK(status)) { reply_nterror(req, status); -- cgit