summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-10-14 04:00:08 +0000
committerTim Potter <tpot@samba.org>2003-10-14 04:00:08 +0000
commitc06d6e0afe489fc13c0e5c5485fcf6f1298c52dc (patch)
tree2a3de0236b8c880384a7e916c6bd6ffd69b9c828 /source3/smbwrapper
parentf631ec52abfca33fea5fe2b04c42e0ca68b17359 (diff)
downloadsamba-c06d6e0afe489fc13c0e5c5485fcf6f1298c52dc.tar.gz
samba-c06d6e0afe489fc13c0e5c5485fcf6f1298c52dc.tar.bz2
samba-c06d6e0afe489fc13c0e5c5485fcf6f1298c52dc.zip
Enclose usage of st_blksize and st_blocks struct stat members in
#ifdef HAVE_STAT_ST_BLKSIZE and #ifdef HAVE_STAT_ST_BLOCKS, respectively. Fixes bug 550 reported by Joachim Schmitz <schmitz@hp.com>. (This used to be commit 3d777f5389ed6b4ab8c42eb110d41f7df309bead)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r--source3/smbwrapper/smbw.c8
-rw-r--r--source3/smbwrapper/smbw_stat.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index 7eb01c7da3..0ddacdf8ba 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -1480,8 +1480,12 @@ say no to acls
st64->st_atime = st->st_atime;
st64->st_mtime = st->st_mtime;
st64->st_ctime = st->st_ctime;
+#ifdef HAVE_STAT_ST_BLKSIZE
st64->st_blksize = st->st_blksize;
+#endif
+#ifdef HAVE_STAT_ST_BLOCKS
st64->st_blocks = st->st_blocks;
+#endif
}
#endif
@@ -1545,8 +1549,12 @@ struct kernel_stat {
st->st_gid = kbuf->st_gid;
st->st_rdev = kbuf->st_rdev;
st->st_size = kbuf->st_size;
+#ifdef HAVE_STAT_ST_BLKSIZE
st->st_blksize = kbuf->st_blksize;
+#endif
+#ifdef HAVE_STAT_ST_BLOCKS
st->st_blocks = kbuf->st_blocks;
+#endif
st->st_atime = kbuf->st_atime_;
st->st_mtime = kbuf->st_mtime_;
st->st_ctime = kbuf->st_ctime_;
diff --git a/source3/smbwrapper/smbw_stat.c b/source3/smbwrapper/smbw_stat.c
index 6c476a8a67..bb76ef006a 100644
--- a/source3/smbwrapper/smbw_stat.c
+++ b/source3/smbwrapper/smbw_stat.c
@@ -41,8 +41,12 @@ void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode)
if (!IS_DOS_READONLY(mode)) st->st_mode |= S_IWUSR;
st->st_size = size;
+#ifdef HAVE_STAT_ST_BLKSIZE
st->st_blksize = 512;
+#endif
+#ifdef HAVE_STAT_ST_BLOCKS
st->st_blocks = (size+511)/512;
+#endif
st->st_uid = getuid();
st->st_gid = getgid();
if (IS_DOS_DIR(mode)) {