mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 16:16:42 +02:00
check open syscall error in PipeStream::do_connect (#1150)
This commit is contained in:
parent
44643fdb8b
commit
5fc40f1049
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue