shell: fix more unused warnings

pull/1290/head
flightlessmango 1 month ago
parent 77d6244cea
commit 976ae0f75a

@ -84,8 +84,14 @@ std::string Shell::exec(std::string cmd) {
return readOutput(); return readOutput();
} }
void Shell::writeCommand(const std::string& command) {
if (write(to_shell[1], command.c_str(), command.length()) == -1)
SPDLOG_ERROR("Failed exit shell");
}
Shell::~Shell() { Shell::~Shell() {
write(to_shell[1], "exit\n", 5); if (write(to_shell[1], "exit\n", 5) == -1)
SPDLOG_ERROR("Failed exit shell");
close(to_shell[1]); close(to_shell[1]);
close(from_shell[0]); close(from_shell[0]);
waitpid(shell_pid, nullptr, 0); waitpid(shell_pid, nullptr, 0);

@ -22,10 +22,7 @@ private:
} }
#endif #endif
void writeCommand(const std::string& command) { void writeCommand(const std::string& command);
write(to_shell[1], command.c_str(), command.length());
}
std::string readOutput(); std::string readOutput();
public: public:

Loading…
Cancel
Save