summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-09-18 02:27:24 +0000
committerAndrew Tridgell <tridge@samba.org>1998-09-18 02:27:24 +0000
commitc1bd188744b0df950f2e00550c25f7d3e148094b (patch)
treeb47eb1c6a9fcbffc464eb43001110edd0572f92f /source
parent24ae7657011929fd3529caa909f3afe866186cd2 (diff)
downloadsamba-c1bd188744b0df950f2e00550c25f7d3e148094b.tar.gz
samba-c1bd188744b0df950f2e00550c25f7d3e148094b.tar.xz
samba-c1bd188744b0df950f2e00550c25f7d3e148094b.zip
removed another use of the LL suffix. Hopefully this is the last one
(a grep doesn't show any more)
Diffstat (limited to 'source')
-rw-r--r--source/smbd/open.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 108ef814ee1..a02fe91e683 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -562,27 +562,25 @@ static void open_file(files_struct *fsp,connection_struct *conn,
static void truncate_unless_locked(files_struct *fsp, connection_struct *conn, int token,
BOOL *share_locked)
{
- if (fsp->can_write){
-#ifdef LARGE_SMB_OFF_T
- if (is_locked(fsp,conn,0x3FFFFFFFFFFFFFFFLL,0,F_WRLCK)){
-#else
- if (is_locked(fsp,conn,0x3FFFFFFF,0,F_WRLCK)){
-#endif
- /* If share modes are in force for this connection we
- have the share entry locked. Unlock it before closing. */
- if (*share_locked && lp_share_modes(SNUM(conn)))
- unlock_share_entry( conn, fsp->fd_ptr->dev,
- fsp->fd_ptr->inode, token);
- close_file(fsp,False);
- /* Share mode no longer locked. */
- *share_locked = False;
- errno = EACCES;
- unix_ERR_class = ERRDOS;
- unix_ERR_code = ERRlock;
- }
- else
- sys_ftruncate(fsp->fd_ptr->fd,0);
- }
+ if (fsp->can_write){
+ SMB_OFF_T mask = ((SMB_OFF_T)0xC) << (SMB_OFF_T_BITS-4);
+
+ if (is_locked(fsp,conn,~mask,0,F_WRLCK)){
+ /* If share modes are in force for this connection we
+ have the share entry locked. Unlock it before closing. */
+ if (*share_locked && lp_share_modes(SNUM(conn)))
+ unlock_share_entry( conn, fsp->fd_ptr->dev,
+ fsp->fd_ptr->inode, token);
+ close_file(fsp,False);
+ /* Share mode no longer locked. */
+ *share_locked = False;
+ errno = EACCES;
+ unix_ERR_class = ERRDOS;
+ unix_ERR_code = ERRlock;
+ } else {
+ sys_ftruncate(fsp->fd_ptr->fd,0);
+ }
+ }
}