diff options
author | Jeremy Allison <jra@samba.org> | 2002-03-20 00:46:53 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-03-20 00:46:53 +0000 |
commit | b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329 (patch) | |
tree | bd74664377abf0b1d0745476d88f6668d06c5718 /source3/smbd/close.c | |
parent | 0cd5dd67ce12f02d3d20568e901ef7666caa8472 (diff) | |
download | samba-b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329.tar.gz samba-b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329.tar.bz2 samba-b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329.zip |
Remove the "stat open" code - make it inline. This should fix the
bugs with opening and renaming mp3 files, also the word rename
problems that people have had for a while.
Needs a make clean :-) make.
Also added JohnR's printing fix.
Jeremy.
(This used to be commit 504e5ef0494c54efbd0357e334cb2aa5a9eb9c14)
Diffstat (limited to 'source3/smbd/close.c')
-rw-r--r-- | source3/smbd/close.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 79b627e924..dc52327cb4 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -75,7 +75,7 @@ static void check_magic(files_struct *fsp,connection_struct *conn) return; } - transfer_file(tmp_fd,outfd,st.st_size); + transfer_file(tmp_fd,outfd,(SMB_OFF_T)st.st_size); close(tmp_fd); close(outfd); } @@ -90,15 +90,17 @@ static int close_filestruct(files_struct *fsp) connection_struct *conn = fsp->conn; int ret = 0; - if(flush_write_cache(fsp, CLOSE_FLUSH) == -1) - ret = -1; + if (fsp->fd != -1) { + if(flush_write_cache(fsp, CLOSE_FLUSH) == -1) + ret = -1; - delete_write_cache(fsp); + delete_write_cache(fsp); + } fsp->is_directory = False; - fsp->stat_open = False; conn->num_files_open--; + SAFE_FREE(fsp->wbmpx_ptr); return ret; } @@ -261,22 +263,6 @@ static int close_directory(files_struct *fsp, BOOL normal_close) } /**************************************************************************** - Close a file opened with null permissions in order to read permissions. -****************************************************************************/ - -static int close_statfile(files_struct *fsp, BOOL normal_close) -{ - close_filestruct(fsp); - - if (fsp->fsp_name) - string_free(&fsp->fsp_name); - - file_free(fsp); - - return 0; -} - -/**************************************************************************** Close a directory opened by an NT SMB call. ****************************************************************************/ @@ -284,7 +270,5 @@ int close_file(files_struct *fsp, BOOL normal_close) { if(fsp->is_directory) return close_directory(fsp, normal_close); - else if(fsp->stat_open) - return close_statfile(fsp, normal_close); return close_normal_file(fsp, normal_close); } |