diff options
Diffstat (limited to 'srclib/apr/file_io/unix/filestat.c')
-rw-r--r-- | srclib/apr/file_io/unix/filestat.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/srclib/apr/file_io/unix/filestat.c b/srclib/apr/file_io/unix/filestat.c index 2779152c..93b6a2b8 100644 --- a/srclib/apr/file_io/unix/filestat.c +++ b/srclib/apr/file_io/unix/filestat.c @@ -81,14 +81,40 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, finfo->device = info->st_dev; finfo->nlink = info->st_nlink; apr_time_ansi_put(&finfo->atime, info->st_atime); +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC) + finfo->atime += info->st_atimensec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_ATIME_N) + finfo->ctime += info->st_atime_n / APR_TIME_C(1000); +#endif + apr_time_ansi_put(&finfo->mtime, info->st_mtime); +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC) + finfo->mtime += info->st_mtimensec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_MTIME_N) + finfo->ctime += info->st_mtime_n / APR_TIME_C(1000); +#endif + apr_time_ansi_put(&finfo->ctime, info->st_ctime); - /* ### needs to be revisited - * if (wanted & APR_FINFO_CSIZE) { - * finfo->csize = info->st_blocks * 512; - * finfo->valid |= APR_FINFO_CSIZE; - * } - */ +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC) + finfo->ctime += info->st_ctimensec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_CTIME_N) + finfo->ctime += info->st_ctime_n / APR_TIME_C(1000); +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#ifdef DEV_BSIZE + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE; +#else + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512; +#endif + finfo->valid |= APR_FINFO_CSIZE; +#endif } apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, |