return ret;
}
+#define get_file_size(sbuf) (sbuf.st_size)
+
/****************************************************************************
Send the required number of replies back.
return(UNIXERROR(ERRDOS,ERRnoaccess));
}
- size = sbuf.st_size;
+ size = get_file_size(sbuf);
fmode = dos_mode(conn,fname,&sbuf);
mtime = sbuf.st_mtime;
inode = sbuf.st_ino;
uint32 reskey=0;
int prev_dirpos=0;
int mode=0;
- SMB_OFF_T size = 0;
+ SMB_OFF_T file_size = 0;
SMB_OFF_T allocation_size = 0;
uint32 len;
time_t mdate=0, adate=0, cdate=0;
continue;
}
- size = sbuf.st_size;
+ file_size = get_file_size(sbuf);
allocation_size = get_allocation_size(&sbuf);
mdate = sbuf.st_mtime;
adate = sbuf.st_atime;
}
if(mode & aDIR)
- size = 0;
+ file_size = 0;
DEBUG(5,("get_lanman2_dir_entry found %s fname=%s\n",pathreal,fname));
put_dos_date2(p,l1_fdateCreation,cdate);
put_dos_date2(p,l1_fdateLastAccess,adate);
put_dos_date2(p,l1_fdateLastWrite,mdate);
- SIVAL(p,l1_cbFile,(uint32)size);
+ SIVAL(p,l1_cbFile,(uint32)file_size);
SIVAL(p,l1_cbFileAlloc,(uint32)allocation_size);
SSVAL(p,l1_attrFile,mode);
p += l1_achName;
put_dos_date2(p,l2_fdateCreation,cdate);
put_dos_date2(p,l2_fdateLastAccess,adate);
put_dos_date2(p,l2_fdateLastWrite,mdate);
- SIVAL(p,l2_cbFile,(uint32)size);
+ SIVAL(p,l2_cbFile,(uint32)file_size);
SIVAL(p,l2_cbFileAlloc,(uint32)allocation_size);
SSVAL(p,l2_attrFile,mode);
SIVAL(p,l2_cbList,0); /* No extended attributes */
put_long_date(p,adate); p += 8;
put_long_date(p,mdate); p += 8;
put_long_date(p,mdate); p += 8;
- SOFF_T(p,0,size);
+ SOFF_T(p,0,file_size);
SOFF_T(p,8,allocation_size);
p += 16;
SIVAL(p,0,nt_extmode); p += 4;
put_long_date(p,adate); p += 8;
put_long_date(p,mdate); p += 8;
put_long_date(p,mdate); p += 8;
- SOFF_T(p,0,size);
+ SOFF_T(p,0,file_size);
SOFF_T(p,8,allocation_size);
p += 16;
SIVAL(p,0,nt_extmode); p += 4;
put_long_date(p,adate); p += 8;
put_long_date(p,mdate); p += 8;
put_long_date(p,mdate); p += 8;
- SOFF_T(p,0,size);
+ SOFF_T(p,0,file_size);
SOFF_T(p,8,allocation_size);
p += 16;
SIVAL(p,0,nt_extmode); p += 4;
SIVAL(p,0,reskey); p+= 4; /* Used for continuing search. */
/* Begin of SMB_QUERY_FILE_UNIX_BASIC */
- SOFF_T(p,0,sbuf.st_size); /* File size 64 Bit */
+ SOFF_T(p,0,get_file_size(sbuf)); /* File size 64 Bit */
p+= 8;
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
SOFF_T(p,0,sbuf.st_blocks*STAT_ST_BLOCKSIZE); /* Number of bytes used on disk - 64 Bit */
#else
/* Can't get the value - fake it using size. */
- SOFF_T(p,0,sbuf.st_size); /* Number of bytes used on disk - 64 Bit */
+ SOFF_T(p,0,get_file_size(sbuf)); /* Number of bytes used on disk - 64 Bit */
#endif
p+= 8;
mode = dos_mode(conn,fname,&sbuf);
fullpathname = fname;
- file_size = sbuf.st_size;
+ file_size = get_file_size(sbuf);
allocation_size = get_allocation_size(&sbuf);
if (mode & aDIR)
file_size = 0;
DEBUG(4,("call_trans2qfilepathinfo: st_mode=%o\n",(int)sbuf.st_mode));
- SOFF_T(pdata,0,sbuf.st_size); /* File size 64 Bit */
+ SOFF_T(pdata,0,get_file_size(sbuf)); /* File size 64 Bit */
pdata += 8;
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
SOFF_T(pdata,0,sbuf.st_blocks*STAT_ST_BLOCKSIZE); /* Number of bytes used on disk - 64 Bit */
#else
/* Can't get the value - fake it using size. */
- SOFF_T(pdata,0,sbuf.st_size); /* Number of bytes used on disk - 64 Bit */
+ SOFF_T(pdata,0,get_file_size(sbuf)); /* Number of bytes used on disk - 64 Bit */
#endif
pdata += 8;
sbuf.st_mtime = fsp->pending_modtime;
}
- size = sbuf.st_size;
+ size = get_file_size(sbuf);
tvs.modtime = sbuf.st_mtime;
tvs.actime = sbuf.st_atime;
dosmode = dos_mode(conn,fname,&sbuf);
DEBUG(10,("call_trans2setfilepathinfo: Set file allocation info for file %s to %.0f\n",
fname, (double)allocation_size ));
- if(allocation_size != sbuf.st_size) {
+ if(allocation_size != get_file_size(sbuf)) {
SMB_STRUCT_STAT new_sbuf;
DEBUG(10,("call_trans2setfilepathinfo: file %s : setting new allocation size to %.0f\n",
return ERROR_NT(NT_STATUS_DISK_FULL);
/* Allocate can truncate size... */
- size = new_sbuf.st_size;
+ size = get_file_size(new_sbuf);
}
break;
* changing the size of a file.
*/
if (!size)
- size = sbuf.st_size;
+ size = get_file_size(sbuf);
}
/*
}
}
- if(size != sbuf.st_size) {
+ if (size != get_file_size(sbuf)) {
int ret;