From: Sara Golemon Date: Sat, 29 Nov 2003 20:01:00 +0000 (+0000) Subject: Add in missing stat element and fix win32 build X-Git-Tag: php-5.0.0b3RC1~509 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9a1d12f71c3708fbe8afff6713b615f1fdd90c0;p=php Add in missing stat element and fix win32 build --- diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 2bc78ac1be..6d4014fdd9 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -760,6 +760,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f } ssb->sb.st_ino = 0; /* Unknown values */ + ssb->sb.st_dev = 0; ssb->sb.st_uid = 0; ssb->sb.st_gid = 0; ssb->sb.st_atime = -1; @@ -767,9 +768,12 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f ssb->sb.st_ctime = -1; ssb->sb.st_nlink = 1; ssb->sb.st_rdev = -1; +#ifdef HAVE_ST_BLKSIZE ssb->sb.st_blksize = 4096; /* Guess since FTP won't expose this information */ - ssb->sb.st_blocks = ceil(ssb->sb.st_size / ssb->sb.st_blksize); - +#ifdef HAVE_ST_BLOCKS + ssb->sb.st_blocks = (int)((4095 + ssb->sb.st_size) / ssb->sb.st_blksize); /* emulate ceil */ +#endif +#endif php_stream_close(stream); php_url_free(resource); return 0;