NetBSD STAT_ST_BLOCKSIZE prob
Patrick Welche
prlw1 at newn.cam.ac.uk
Wed Dec 4 17:49:00 GMT 2002
With cvs code from Dec 4 16:55 GMT on i386-unknown-netbsdelf1.6K,
Compiling smbd/trans2.c
smbd/trans2.c: In function `get_allocation_size':
smbd/trans2.c:42: request for member `st_size' in something not a structure or union
smbd/trans2.c 39-43:
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
ret = (SMB_BIG_UINT)STAT_ST_BLOCKSIZE * (SMB_BIG_UINT)sbuf->st_blocks;
#else
ret = (SMB_BIG_UINT)get_file_size(*sbuf);
#endif
include/config.h:
#define HAVE_STAT_ST_BLOCKS 1
/* #undef STAT_ST_BLOCKSIZE */
#define HAVE_STAT_ST_BLKSIZE 1
(Why isn't STAT_ST_BLOCKSIZE defined in configure.in for netbsd?)
smbd/trans2.c 32:
#define get_file_size(sbuf) (sbuf.st_size)
(lib/util.c: SMB_OFF_T get_file_size(char *file_name) ?)
Ah: the patch which fixes this is: (tut tut coding style! ;) )
Cheers,
Patrick
Index: smbd/trans2.c
===================================================================
RCS file: /cvsroot/samba/source/smbd/trans2.c,v
retrieving revision 1.238
diff -u -r1.238 trans2.c
--- smbd/trans2.c 4 Dec 2002 03:21:18 -0000 1.238
+++ smbd/trans2.c 4 Dec 2002 17:38:53 -0000
@@ -29,7 +29,7 @@
extern int global_oplock_break;
extern uint32 global_client_caps;
-#define get_file_size(sbuf) (sbuf.st_size)
+#define get_file_size(sbuf) ((sbuf).st_size)
/* given a stat buffer return the allocated size on disk, taking into
account sparse files */
More information about the samba-technical
mailing list