Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
464b6117
Commit
464b6117
authored
Oct 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input_stream: input_stream_close() returns void
close() shouldn't fail with read-only streams.
parent
f08041f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
13 deletions
+7
-13
input_curl.c
src/input_curl.c
+1
-2
input_file.c
src/input_file.c
+2
-7
input_stream.c
src/input_stream.c
+2
-2
input_stream.h
src/input_stream.h
+2
-2
No files found.
src/input_curl.c
View file @
464b6117
...
...
@@ -235,11 +235,10 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size)
return
nbytes
;
}
static
int
static
void
input_curl_close
(
struct
input_stream
*
is
)
{
input_curl_free
(
is
);
return
0
;
}
static
int
...
...
src/input_file.c
View file @
464b6117
...
...
@@ -78,15 +78,10 @@ input_file_read(struct input_stream *is, void *ptr, size_t size)
return
readSize
;
}
static
int
static
void
input_file_close
(
struct
input_stream
*
is
)
{
if
(
fclose
((
FILE
*
)
is
->
data
)
<
0
)
{
is
->
error
=
errno
;
return
-
1
;
}
return
0
;
fclose
((
FILE
*
)
is
->
data
);
}
static
int
...
...
src/input_stream.c
View file @
464b6117
...
...
@@ -85,7 +85,7 @@ input_stream_read(struct input_stream *is, void *ptr, size_t size)
return
is
->
plugin
->
read
(
is
,
ptr
,
size
);
}
int
input_stream_close
(
struct
input_stream
*
is
)
void
input_stream_close
(
struct
input_stream
*
is
)
{
if
(
is
->
mime
)
free
(
is
->
mime
);
...
...
@@ -94,7 +94,7 @@ int input_stream_close(struct input_stream *is)
if
(
is
->
meta_title
)
free
(
is
->
meta_title
);
return
is
->
plugin
->
close
(
is
);
is
->
plugin
->
close
(
is
);
}
int
input_stream_eof
(
struct
input_stream
*
is
)
...
...
src/input_stream.h
View file @
464b6117
...
...
@@ -26,7 +26,7 @@ struct input_stream;
struct
input_plugin
{
bool
(
*
open
)(
struct
input_stream
*
is
,
const
char
*
url
);
int
(
*
close
)(
struct
input_stream
*
is
);
void
(
*
close
)(
struct
input_stream
*
is
);
int
(
*
buffer
)(
struct
input_stream
*
is
);
size_t
(
*
read
)(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
);
...
...
@@ -58,7 +58,7 @@ void input_stream_global_finish(void);
for the input stream is set */
int
input_stream_open
(
struct
input_stream
*
is
,
char
*
url
);
int
input_stream_seek
(
struct
input_stream
*
is
,
long
offset
,
int
whence
);
int
input_stream_close
(
struct
input_stream
*
is
);
void
input_stream_close
(
struct
input_stream
*
is
);
int
input_stream_eof
(
struct
input_stream
*
is
);
/* return value: -1 is error, 1 inidicates stuff was buffered, 0 means nothing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment