mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-10 23:01:45 +02:00
Don't close a null stream
This commit is contained in:
parent
9442d2d202
commit
af3300ccca
1 changed files with 6 additions and 1 deletions
|
@ -72,7 +72,12 @@ namespace strutils = utils::string;
|
|||
#ifndef WINDOWS
|
||||
static std::string execGetOutput(const std::string& cmd)
|
||||
{
|
||||
std::shared_ptr<::FILE> pipe(popen((cmd + " 2> /dev/null").c_str(), "r"), pclose);
|
||||
std::shared_ptr<::FILE> pipe(popen((cmd + " 2> /dev/null").c_str(), "r"),
|
||||
[](::FILE* stream)
|
||||
{
|
||||
if (stream)
|
||||
pclose(stream);
|
||||
});
|
||||
if (!pipe)
|
||||
return "";
|
||||
char buffer[1024];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue