Lines Matching refs:inname
2441 - const char *inname __attribute__ ((__unused__)),
2443 + const char *inname,
2476 m = file_zmagic(ms, &b, inname);
2976 - return file_or_fd(ms, inname, STDIN_FILENO);
2977 + return file_or_stream(ms, inname, NULL);
2989 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2990 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
3012 switch (file_fsmagic(ms, inname, &sb)) {
3022 - if (inname != NULL) {
3025 - if ((fd = open(inname, flags)) < 0) {
3026 - okstat = stat(inname, &sb) == 0;
3042 - unreadable_info(ms, sb.st_mode, inname) == -1)
3045 + if (inname && !stream) {
3047 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
3049 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
3061 - if (inname == NULL)
3066 + file_error(ms, errno, "cannot stat `%s'", inname);
3087 - if (nbytes == 0 && inname) {
3089 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
3103 - if (inname == NULL && fd != STDIN_FILENO)
3107 - inname == NULL ? "/dev/stdin" : inname);
3111 + file_error(ms, errno, "cannot read `%s'", inname);
3116 - if (file_buffer(ms, fd, okstat ? &sb : NULL, inname, buf, CAST(size_t, nbytes)) == -1)
3117 + if (file_buffer(ms, stream, &sb, inname, buf, CAST(size_t, nbytes)) == -1)
3125 - close_and_restore(ms, inname, fd, &sb);