History

Fix standalone compilation of pipe protocol.

file_check() is not only used by the file protocol, adjust #ifdef accordingly.

Diego Biurrun committed 15 years ago

Commit 87995411 parent 3d269051 file · +13 −13Browse files

Unified · Split

libavformat/file.c+13−13
@@ -51,6 +51,19 @@ static int file_get_handle(URLContext *h) · 50 unmodified lines
51 return (intptr_t) h->priv_data;51 return (intptr_t) h->priv_data;
52}52}
53 53
54static int file_check(URLContext *h, int mask)
55{
56 struct stat st;
57 int ret = stat(h->filename, &st);
58 if (ret < 0)
59 return AVERROR(errno);
60
61 ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0;
62 ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
63
64 return ret;
65}
66
54#if CONFIG_FILE_PROTOCOL67#if CONFIG_FILE_PROTOCOL
55 68
56static int file_open(URLContext *h, const char *filename, int flags)69static int file_open(URLContext *h, const char *filename, int flags)
@@ -95,19 +108,6 @@ static int file_close(URLContext *h) · 38 unmodified lines
95 return close(fd);108 return close(fd);
96}109}
97 110
98static int file_check(URLContext *h, int mask)
99{
100 struct stat st;
101 int ret = stat(h->filename, &st);
102 if (ret < 0)
103 return AVERROR(errno);
104
105 ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0;
106 ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
107
108 return ret;
109}
110
111URLProtocol ff_file_protocol = {111URLProtocol ff_file_protocol = {
112 .name = "file",112 .name = "file",
113 .url_open = file_open,113 .url_open = file_open,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t