diff options
author | Jeremy Allison <jra@samba.org> | 1998-07-28 18:15:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-07-28 18:15:31 +0000 |
commit | 7abcd0521e36425bf7c3dc90929c00ed49e9ab07 (patch) | |
tree | c60e3192ada229a9fdf5f81fe085d3f279256928 /source3/smbd/server.c | |
parent | 1aa138922e5c0e4925ff5cbfcdb4e7cad367b31b (diff) | |
download | samba-7abcd0521e36425bf7c3dc90929c00ed49e9ab07.tar.gz samba-7abcd0521e36425bf7c3dc90929c00ed49e9ab07.tar.bz2 samba-7abcd0521e36425bf7c3dc90929c00ed49e9ab07.zip |
loadparm.c: Added strict sync parameter.
locking.c: Added code to deal with real open mode of file.
reply.c: Added strict sync parameter.
server.c: Added strict sync parameter. Fixed open modes.
Jeremy.
(This used to be commit ed57b603b5c9333d588e62d774ad2be67e43ffd9)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r-- | source3/smbd/server.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 49ce759945..151a6d7ded 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1435,12 +1435,9 @@ static void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct #else /* No EROFS */ if((fd_ptr->fd == -1) && (errno == EACCES)) { #endif /* EROFS */ - if(flags & O_WRONLY) { - fd_ptr->fd = fd_attempt_open(fname, open_flags|O_WRONLY, mode); - fd_ptr->real_open_flags = O_WRONLY; - } else { - fd_ptr->fd = fd_attempt_open(fname, open_flags|O_RDONLY, mode); - fd_ptr->real_open_flags = O_RDONLY; + if(accmode != O_RDWR) { + fd_ptr->fd = fd_attempt_open(fname, open_flags|accmode, mode); + fd_ptr->real_open_flags = accmode; } } } @@ -1564,10 +1561,11 @@ static void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct /******************************************************************* sync a file ********************************************************************/ -void sync_file(int fnum) +void sync_file(int cnum, int fnum) { #ifndef NO_FSYNC - fsync(Files[fnum].fd_ptr->fd); + if(lp_strict_sync(SNUM(cnum))) + fsync(Files[fnum].fd_ptr->fd); #endif } |