summaryrefslogtreecommitdiff
path: root/source3
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
commitb3b44e02f3c0c2f6c4b66bc112e546a08ef45316 (patch)
tree9c49bb7ec3fac45bab6ac21bc2ac8af823580013 /source3
parent55c492fba1da31bc82de5bba5e19dec54b18e2ce (diff)
downloadsamba-b3b44e02f3c0c2f6c4b66bc112e546a08ef45316.tar.gz
samba-b3b44e02f3c0c2f6c4b66bc112e546a08ef45316.tar.bz2
samba-b3b44e02f3c0c2f6c4b66bc112e546a08ef45316.zip
removed another use of the LL suffix. Hopefully this is the last one
(a grep doesn't show any more) (This used to be commit c1bd188744b0df950f2e00550c25f7d3e148094b)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 108ef814ee..a02fe91e68 100644
--- a/source3/smbd/open.c
+++ b/source3/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);
+ }
+ }
}