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
962cf32b
Commit
962cf32b
authored
Sep 07, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_input: pass FileDescriptor to dump_input_stream()
parent
ae236823
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
run_input.cxx
test/run_input.cxx
+3
-5
No files found.
test/run_input.cxx
View file @
962cf32b
...
...
@@ -130,7 +130,7 @@ tag_save(FILE *file, const Tag &tag)
}
static
int
dump_input_stream
(
InputStream
&
is
)
dump_input_stream
(
InputStream
&
is
,
FileDescriptor
out
)
{
const
std
::
lock_guard
<
Mutex
>
protect
(
is
.
mutex
);
...
...
@@ -155,9 +155,7 @@ dump_input_stream(InputStream &is)
if
(
num_read
==
0
)
break
;
ssize_t
num_written
=
write
(
1
,
buffer
,
num_read
);
if
(
num_written
<=
0
)
break
;
out
.
FullWrite
(
buffer
,
num_read
);
}
is
.
Check
();
...
...
@@ -234,7 +232,7 @@ try {
Mutex
mutex
;
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
mutex
);
return
dump_input_stream
(
*
is
);
return
dump_input_stream
(
*
is
,
FileDescriptor
(
STDOUT_FILENO
)
);
}
catch
(...)
{
PrintException
(
std
::
current_exception
());
return
EXIT_FAILURE
;
...
...
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