Browse Source

Debugging of subprocesses

default_compile_flags
vector-of-bool 5 years ago
parent
commit
b3f16faee6
2 changed files with 5 additions and 1 deletions
  1. +3
    -0
      src/dds/dds.main.cpp
  2. +2
    -1
      src/dds/proc.nix.cpp

+ 3
- 0
src/dds/dds.main.cpp View File

*/ */


int main(int argc, char** argv) { int main(int argc, char** argv) {
#if DDS_DEBUG
spdlog::set_level(spdlog::level::debug);
#endif
spdlog::set_pattern("[%H:%M:%S] [%^%-5l%$] %v"); spdlog::set_pattern("[%H:%M:%S] [%^%-5l%$] %v");
args::ArgumentParser parser("DDS - The drop-dead-simple library manager"); args::ArgumentParser parser("DDS - The drop-dead-simple library manager");



+ 2
- 1
src/dds/proc.nix.cpp View File



#include <dds/util/signal.hpp> #include <dds/util/signal.hpp>


#include <spdlog/fmt/fmt.h>
#include <spdlog/spdlog.h>


#include <poll.h> #include <poll.h>
#include <sys/wait.h> #include <sys/wait.h>
} // namespace } // namespace


proc_result dds::run_proc(const std::vector<std::string>& command) { proc_result dds::run_proc(const std::vector<std::string>& command) {
spdlog::debug("Spawning subprocess: {}", quote_command(command));
int stdio_pipe[2] = {}; int stdio_pipe[2] = {};
auto rc = ::pipe(stdio_pipe); auto rc = ::pipe(stdio_pipe);
check_rc(rc == 0, "Create stdio pipe for subprocess"); check_rc(rc == 0, "Create stdio pipe for subprocess");

Loading…
Cancel
Save