MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / handleLeftoverProcesses

Method handleLeftoverProcesses

syncthingconnector/syncthingprocess.cpp:745–766  ·  view source on GitHub ↗

! * \brief Terminates all processes in the group forcefully and waits until they're gone. */

Source from the content-addressed store, hash-verified

743 * \brief Terminates all processes in the group forcefully and waits until they're gone.
744 */
745void SyncthingProcess::handleLeftoverProcesses()
746{
747#ifdef LIB_SYNCTHING_CONNECTOR_BOOST_PROCESS
748 if (!m_process->group.valid()) {
749 return;
750 }
751 auto ec = std::error_code();
752 m_process->group.terminate(ec);
753 if (ec && ec != std::errc::no_such_process) {
754 std::cerr << EscapeCodes::Phrases::Error << "Unable to kill leftover processes in group " << m_process->group.native_handle() << ": "
755 << ec.message() << EscapeCodes::Phrases::End;
756 }
757 if (!m_process->group.valid()) {
758 return;
759 }
760 m_process->group.wait(ec); // wait until group has terminated: Is this ever required?
761 if (ec && ec != std::errc::no_such_process) {
762 std::cerr << EscapeCodes::Phrases::Error << "Unable to wait for leftover processes in group " << m_process->group.native_handle() << ": "
763 << ec.message() << EscapeCodes::Phrases::End;
764 }
765#endif
766}
767
768qint64 SyncthingProcess::bytesAvailable() const
769{

Callers

nothing calls this directly

Calls 1

terminateMethod · 0.45

Tested by

no test coverage detected