Lines Matching refs:inname
2157 - const char *inname __attribute__ ((__unused__)),
2159 + const char *inname,
2192 m = file_zmagic(ms, &b, inname);
2701 - return file_or_fd(ms, inname, STDIN_FILENO);
2702 + return file_or_stream(ms, inname, NULL);
2714 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2715 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2737 switch (file_fsmagic(ms, inname, &sb)) {
2747 - if (inname != NULL) {
2750 - if ((fd = open(inname, flags)) < 0) {
2751 - okstat = stat(inname, &sb) == 0;
2767 - unreadable_info(ms, sb.st_mode, inname) == -1)
2770 + if (inname && !stream) {
2772 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
2774 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
2789 - if (inname == NULL)
2794 + file_error(ms, errno, "cannot stat `%s'", inname);
2815 - if (nbytes == 0 && inname) {
2817 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
2831 - if (inname == NULL && fd != STDIN_FILENO)
2835 - inname == NULL ? "/dev/stdin" : inname);
2839 + file_error(ms, errno, "cannot read `%s'", inname);
2844 - if (file_buffer(ms, fd, okstat ? &sb : NULL, inname, buf, CAST(size_t, nbytes)) == -1)
2845 + if (file_buffer(ms, stream, &sb, inname, buf, CAST(size_t, nbytes)) == -1)
2853 - close_and_restore(ms, inname, fd, &sb);