瀏覽代碼

Debugging of subprocesses

default_compile_flags
vector-of-bool 5 年之前
父節點
當前提交
b3f16faee6
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. +3
    -0
      src/dds/dds.main.cpp
  2. +2
    -1
      src/dds/proc.nix.cpp

+ 3
- 0
src/dds/dds.main.cpp 查看文件

*/ */


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 查看文件



#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…
取消
儲存