Skip to content

Commit

Permalink
check open syscall error in PipeStream::do_connect (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileys authored Oct 25, 2023
1 parent 44643fd commit 5fc40f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/streamreader/pipe_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ PipeStream::PipeStream(PcmStream::Listener* pcmListener, boost::asio::io_context
void PipeStream::do_connect()
{
int fd = open(uri_.path.c_str(), O_RDONLY | O_NONBLOCK);
if (fd < 0)
throw SnapException("failed to open fifo \"" + uri_.path + "\": " + cpt::to_string(errno));

int pipe_size = -1;
#if !defined(MACOS) && !defined(FREEBSD)
pipe_size = fcntl(fd, F_GETPIPE_SZ);
Expand Down

0 comments on commit 5fc40f1

Please sign in to comment.