summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-06-07 23:06:28 +0200
committerKarolin Seeger <kseeger@samba.org>2010-09-27 21:29:04 +0200
commitdf774be5b1a022562342f896d179639f2f5bd89c (patch)
tree0f8100e5ba8cd754c83dfb00ccb01c6a689dcd97 /source3/lib
parent44c7f7da21fdc6fa13e16859767f63674b9ada2d (diff)
downloadsamba-df774be5b1a022562342f896d179639f2f5bd89c.tar.gz
s3: fix build on platforms without st_blocks and st_blksize stat struct members
This fixes bug 7474. (cherry picked from commit 18516e062c9c4fc2a61a7ef7c8b173683c02e2e8)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index a58d9037a79..1ce635fef60 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -534,8 +534,17 @@ static void init_stat_ex_from_stat (struct stat_ex *dst,
dst->st_ex_mtime = get_mtimespec(src);
dst->st_ex_ctime = get_ctimespec(src);
make_create_timespec(src, dst, fake_dir_create_times);
+#ifdef HAVE_STAT_ST_BLKSIZE
dst->st_ex_blksize = src->st_blksize;
+#else
+ dst->st_ex_blksize = STAT_ST_BLOCKSIZE;
+#endif
+
+#ifdef HAVE_STAT_ST_BLOCKS
dst->st_ex_blocks = src->st_blocks;
+#else
+ dst->st_ex_blocks = src->st_size / dst->st_ex_blksize + 1;
+#endif
#ifdef HAVE_STAT_ST_FLAGS
dst->st_ex_flags = src->st_flags;