Lines Matching refs:inname
2094 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
2096 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2110 - m = file_zmagic(ms, fd, inname, ubuf, nb);
2111 + m = file_zmagic(ms, stream, inname, ubuf, nb);
2628 - return file_or_fd(ms, inname, STDIN_FILENO);
2629 + return file_or_stream(ms, inname, NULL);
2641 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2642 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2656 + if (!inname && !stream) {
2669 - switch (file_fsmagic(ms, inname, &sb)) {
2670 + switch (file_fsmagic(ms, inname, &sb, stream)) {
2684 - if (inname == NULL) {
2691 - int okstat = stat(inname, &sb) == 0;
2700 + if (!stream && inname) {
2702 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
2706 - if ((fd = open(inname, flags)) < 0) {
2720 - unreadable_info(ms, sb.st_mode, inname) == -1)
2724 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
2752 - if (nbytes == 0 && inname) {
2754 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
2768 - if (inname == NULL && fd != STDIN_FILENO)
2772 - inname == NULL ? "/dev/stdin" : inname);
2776 + file_error(ms, errno, "cannot read `%s'", inname);
2781 - if (file_buffer(ms, fd, inname, buf, (size_t)nbytes) == -1)
2782 + if (file_buffer(ms, stream, inname, buf, (size_t)nbytes) == -1)
2790 - close_and_restore(ms, inname, fd, &sb);