summaryrefslogtreecommitdiffstats
path: root/source3/locking/posix.c
diff options
context:
space:
mode:
authorRalph Boehme <rb@sernet.de>2014-06-01 15:16:16 +0200
committerMichael Adam <obnox@samba.org>2014-06-13 13:22:18 +0200
commit3defbe273459262f333cca91e90a0941a812df1a (patch)
tree4737099ca5071ec0bb604928b7b78b72ab6478cf /source3/locking/posix.c
parent00573880e5f0362c3c442e82501bb0efe731ce7b (diff)
downloadsamba-3defbe273459262f333cca91e90a0941a812df1a.tar.gz
samba-3defbe273459262f333cca91e90a0941a812df1a.tar.xz
samba-3defbe273459262f333cca91e90a0941a812df1a.zip
locking: use correct conversion specifier for printing variables
Fix several occurences of using printf conversion to fload when printing offset and count variables in locking debug messages and smbstatus. Conversion to float may lead to wrong results with very large values. Signed-off-by: Ralph Boehme <rb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/locking/posix.c')
-rw-r--r--source3/locking/posix.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 2d89110b7d..908cd57d5d 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -186,7 +186,8 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, off_t offset, off_t coun
{
bool ret;
- DEBUG(8,("posix_fcntl_lock %d %d %.0f %.0f %d\n",fsp->fh->fd,op,(double)offset,(double)count,type));
+ DEBUG(8,("posix_fcntl_lock %d %d %jd %jd %d\n",
+ fsp->fh->fd,op,(intmax_t)offset,(intmax_t)count,type));
ret = SMB_VFS_LOCK(fsp, op, offset, count, type);
@@ -1165,9 +1166,9 @@ bool set_posix_lock_posix_flavour(files_struct *fsp,
off_t count;
int posix_lock_type = map_posix_lock_type(fsp,lock_type);
- DEBUG(5,("set_posix_lock_posix_flavour: File %s, offset = %.0f, count "
- "= %.0f, type = %s\n", fsp_str_dbg(fsp),
- (double)u_offset, (double)u_count,
+ DEBUG(5,("set_posix_lock_posix_flavour: File %s, offset = %ju, count "
+ "= %ju, type = %s\n", fsp_str_dbg(fsp),
+ (uintmax_t)u_offset, (uintmax_t)u_count,
posix_lock_type_name(lock_type)));
/*
@@ -1181,8 +1182,8 @@ bool set_posix_lock_posix_flavour(files_struct *fsp,
if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,posix_lock_type)) {
*errno_ret = errno;
- DEBUG(5,("set_posix_lock_posix_flavour: Lock fail !: Type = %s: offset = %.0f, count = %.0f. Errno = %s\n",
- posix_lock_type_name(posix_lock_type), (double)offset, (double)count, strerror(errno) ));
+ DEBUG(5,("set_posix_lock_posix_flavour: Lock fail !: Type = %s: offset = %ju, count = %ju. Errno = %s\n",
+ posix_lock_type_name(posix_lock_type), (intmax_t)offset, (intmax_t)count, strerror(errno) ));
return False;
}
return True;