Lines Matching refs:inname
2948 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
2950 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2974 m = file_zmagic(ms, &b, inname);
3482 - return file_or_fd(ms, inname, STDIN_FILENO);
3483 + return file_or_stream(ms, inname, NULL);
3495 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
3496 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
3510 + if (!inname && !stream) {
3523 - switch (file_fsmagic(ms, inname, &sb)) {
3524 + switch (file_fsmagic(ms, inname, &sb, stream)) {
3538 - if (inname == NULL) {
3545 - int okstat = stat(inname, &sb) == 0;
3554 + if (!stream && inname) {
3556 + stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
3560 - if ((fd = open(inname, flags)) < 0) {
3574 - unreadable_info(ms, sb.st_mode, inname) == -1)
3578 + if (unreadable_info(ms, sb.st_mode, inname) == -1)
3606 - if (nbytes == 0 && inname) {
3608 - if (unreadable_info(ms, sb.st_mode, inname) == -1)
3622 - if (inname == NULL && fd != STDIN_FILENO)
3626 - inname == NULL ? "/dev/stdin" : inname);
3630 + file_error(ms, errno, "cannot read `%s'", inname);
3635 - if (file_buffer(ms, fd, inname, buf, (size_t)nbytes) == -1)
3636 + if (file_buffer(ms, stream, inname, buf, (size_t)nbytes) == -1)
3644 - close_and_restore(ms, inname, fd, &sb);