summaryrefslogtreecommitdiff
path: root/ext/fileinfo/libmagic/apprentice.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-19 21:35:13 +0200
committerAnatol Belski <ab@php.net>2014-08-19 21:35:13 +0200
commitac6d6aebd89e2fb6bf1134c12b1582636f818a62 (patch)
tree11da4dc47414343f2a720de9c60633ba4b5a0f6b /ext/fileinfo/libmagic/apprentice.c
parent7eba90705abbd8739709ea2921aa0701bf1200ea (diff)
downloadphp-git-ac6d6aebd89e2fb6bf1134c12b1582636f818a62.tar.gz
ported ext/fileinfo
Diffstat (limited to 'ext/fileinfo/libmagic/apprentice.c')
-rw-r--r--ext/fileinfo/libmagic/apprentice.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index ce747378aa..b3b1f746d4 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -1145,7 +1145,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
uint32_t i, j;
size_t files = 0, maxfiles = 0;
char **filearr = NULL;
- struct stat st;
+ php_stat_t st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
php_stream *dir;
@@ -1187,7 +1187,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
php_stream_closedir(dir);
goto out;
}
- if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
+ if (zend_stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
continue;
}
if (files >= maxfiles) {
@@ -2698,7 +2698,7 @@ internal_loaded:
if (NULL != fn) {
nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
- if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
+ if ((php_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu",
dbname, (unsigned long long)st.sb.st_size,
sizeof(struct magic));
@@ -2788,7 +2788,7 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
assert(nm + sizeof(ar) < m);
- if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
+ if (php_stream_seek(stream,(php_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
file_error(ms, errno, "error seeking `%s'", dbname);
goto out;
}