SYNERGY-988 - Normalize scrolling direction (#7044)
* SYNERGY-988 - Normalize scrolling direction on Mac * SYNERGY-988 - Scroll direction check on Windows * SYNERGY-988 - Add check for registry key presence * SYNERGY-988 - Normalize scrolling directino on Linux * SYNERGY-988 - Detach scroll direction check on Windows * SYNERGY-988 - Update changelog * SYNERGY-988 - Resolve code smells * SYNERGY-988 - Normalize scroll direction for Linux servers * SYNERGY-988 - Removed unnecessary INFO level logs Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com>
This commit is contained in:
@ -19,6 +19,10 @@
|
||||
#include "arch/unix/ArchSystemUnix.h"
|
||||
|
||||
#include <sys/utsname.h>
|
||||
#include <stdio.h>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
//
|
||||
// ArchSystemUnix
|
||||
@ -78,3 +82,21 @@ ArchSystemUnix::getLibsUsed(void) const
|
||||
{
|
||||
return "not implemented.\nuse lsof on shell";
|
||||
}
|
||||
|
||||
std::string
|
||||
ArchSystemUnix::runCommand(const std::string& cmd)
|
||||
{
|
||||
std::array<char, 128> buffer;
|
||||
std::string result;
|
||||
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), &pclose);
|
||||
if (!pipe)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr)
|
||||
{
|
||||
result += buffer.data();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user