1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

Add in missing stat element and fix win32 build

This commit is contained in:
Sara Golemon
2003-11-29 20:01:00 +00:00
parent e39e452e30
commit e9a1d12f71
+6 -2
View File
@@ -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;