Lines Matching refs:inname
1963 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
1965 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
1998 - if ((m = file_zmagic(ms, fd, inname, ubuf, nb)) != 0) {
1999 + if ((m = file_zmagic(ms, stream, inname, ubuf, nb)) != 0) {
2345 - return file_or_fd(ms, inname, STDIN_FILENO);
2346 + return file_or_stream(ms, inname, NULL);
2358 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2359 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2370 + if (!inname && !stream) {
2386 - switch (file_fsmagic(ms, inname, &sb)) {
2387 + switch (file_fsmagic(ms, inname, &sb, stream)) {
2395 - if (inname == NULL) {
2402 - int okstat = stat(inname, &sb) == 0;
2411 + if (!stream && inname) {
2413 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
2417 - if ((fd = open(inname, flags)) < 0) {
2419 - unreadable_info(ms, sb.st_mode, inname) == -1)
2423 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
2453 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
2461 - file_error(ms, errno, "cannot read `%s'", inname);
2465 + file_error(ms, errno, "cannot read `%s'", inname);
2470 - if (file_buffer(ms, fd, inname, buf, (size_t)nbytes) == -1)
2471 + if (file_buffer(ms, stream, inname, buf, (size_t)nbytes) == -1)
2478 - close_and_restore(ms, inname, fd, &sb);
2485 + close_and_restore(ms, inname, 0, &sb);