diff options
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r-- | source3/smbd/fileio.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index edf87f3e7b..971d309ff9 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -115,3 +115,15 @@ int write_file(files_struct *fsp,char *data,int n) return(write_data(fsp->fd_ptr->fd,data,n)); } + +/******************************************************************* +sync a file +********************************************************************/ +void sync_file(connection_struct *conn, files_struct *fsp) +{ +#ifdef HAVE_FSYNC + if(lp_strict_sync(SNUM(conn))) + fsync(fsp->fd_ptr->fd); +#endif +} + |