diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-11-30 15:13:19 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-11-30 15:13:19 +0000 |
commit | 20b92bf4ccb82edd5487f70d2736c65deb3b22f5 (patch) | |
tree | 4ef3e27c7efb7689d1920791b4b2f419d4a7d354 /ext/mime_magic | |
parent | 57130c653a6cbec5c776bf76db484a2d9f6ee2fa (diff) | |
download | php-git-20b92bf4ccb82edd5487f70d2736c65deb3b22f5.tar.gz |
Use thread-safe code
Diffstat (limited to 'ext/mime_magic')
-rw-r--r-- | ext/mime_magic/mime_magic.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c index d4ef4dbec0..c4a4ebaf24 100644 --- a/ext/mime_magic/mime_magic.c +++ b/ext/mime_magic/mime_magic.c @@ -1755,12 +1755,15 @@ static void mprint(union VALUETYPE *p, struct magic *m) case DATE: case BEDATE: case LEDATE: - /* XXX: not multithread safe */ - pp = ctime((time_t *) & p->l); - if ((rt = strchr(pp, '\n')) != NULL) - *rt = '\0'; - (void) magic_rsl_printf(m->desc, pp); - return; + { + char ctimebuf[52]; + pp = php_ctime_r((time_t *) &p->l, ctimebuf); + if ((rt = strchr(pp, '\n')) != NULL) { + *rt = '\0'; + } + (void) magic_rsl_printf(m->desc, pp); + return; + } default: { TSRMLS_FETCH(); |