Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
time-killer-games committed Sep 27, 2024
1 parent 5674e69 commit c7bfe99
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/boost/process/v2/posix/default_launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <unistd.h>


#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__MACH__)
#if defined(__APPLE__) || defined(__MACH__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
extern "C" { extern char **environ; }
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/ext/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
};

std::unique_ptr<kvm_t, closer> kd{kvm_openfiles(nullptr, nullptr, nullptr, KVM_NO_FILES, nullptr)};
if (!kd) {BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) return vec;}
if (!kd.get()) {BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) return {};}
if ((proc_info = kvm_getprocs(kd.get(), KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &cntp)))
{
char **cmd = kvm_getargv(kd.get(), proc_info, 0);
Expand All @@ -354,7 +354,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
}
else
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec)
kvm_close(kd);
kvm_close(kd.get());
return {};
}

Expand Down
4 changes: 2 additions & 2 deletions src/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ std::vector<pid_type> all_pids(boost::system::error_code & ec)
vec.reserve(cntp);
for (int i = cntp - 1; i >= 0; i--)
{
if (proc_info[i].kp_pid >= 0)
if (proc_info[i].p_pid >= 0)
{
vec.push_back(proc_info[i].kp_pid);
vec.push_back(proc_info[i].p_pid);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/posix/close_handles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
// linux has close_range since 5.19


#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__)

// https://www.freebsd.org/cgi/man.cgi?query=close_range&apropos=0&sektion=0&manpath=FreeBSD+13.1-RELEASE+and+Ports&arch=default&format=html
// https://man.netbsd.org/closefrom.3
// __FreeBSD__
//
// gives us
Expand Down
6 changes: 3 additions & 3 deletions src/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if defined(BOOST_PROCESS_V2_WINDOWS)
#include <windows.h>
#include <shellapi.h>
#else
#elif defined(__OpenBSD__)
#include <wordexp.h>
#endif

Expand All @@ -30,7 +30,7 @@ BOOST_PROCESS_V2_DECL const error_category& get_shell_category()
{
return system_category();
}
#else
#elif defined(__OpenBSD__)

struct shell_category_t final : public error_category
{
Expand Down Expand Up @@ -92,7 +92,7 @@ auto shell::args() const-> args_type
return input_.c_str();
}

#else
#elif defined(__OpenBSD__)

void shell::parse_()
{
Expand Down

0 comments on commit c7bfe99

Please sign in to comment.