Skip to content

Commit

Permalink
Prevent conflict with cstdlib system
Browse files Browse the repository at this point in the history
  • Loading branch information
eschan145 authored Jan 19, 2025
1 parent 4e61336 commit f555d0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void set_kill_method(int value) {
default_kill_method = static_cast<KillMethod>(value);
}

DK_API bool system(const std::string& command) {
DK_API bool execute(const std::string& command) {
STARTUPINFO si = {sizeof(STARTUPINFO)};
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
Expand Down Expand Up @@ -351,14 +351,14 @@ DK_API bool taskkill(DWORD identifier, KillMethod method) {
case KillMethod::SYSTEM: {
std::string command = "TASKKILL /PID " +
std::to_string(identifier) + "/F";
system(command);
dieknow::execute(command);
return true;
}

case KillMethod::WMIC: {
std::string command = "wmic process where ProcessId=" +
std::to_string(identifier) + " delete";
system(command);
dieknow::execute(command);
return true;
}

Expand Down

0 comments on commit f555d0c

Please sign in to comment.