1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

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 commit is contained in:
Tim Potter
-
parent f899448348
commit 18adfdbe0c
4 changed files with 26 additions and 0 deletions

View File

@ -1139,8 +1139,12 @@ int smbc_setup_stat(SMBCCTX *context, struct stat *st, char *fname, size_t size,
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();