Skip to content

Commit

Permalink
Return 0 on success in getvcp/setvcp (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtai committed Jun 14, 2023
1 parent 961d857 commit 7f08f36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions winddcutil/winddcutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ int getVcp(std::vector<std::string> args) {
bool success = GetVCPFeatureAndVCPFeatureReply(physicalMonitorHandle, vcpCode, NULL, &currentValue, NULL);
if (!success) {
std::cerr << "Failed to get the vcp code value" << std::endl;
return success;
return 1;
}

std::stringstream ss;
ss << std::hex << currentValue;
std::cout << "VCP " << args[1] << " " << ss.str() << std::endl;

return success;
return 0;
}

int setVcp(std::vector<std::string> args) {
Expand Down Expand Up @@ -156,9 +156,11 @@ int setVcp(std::vector<std::string> args) {
}

bool success = SetVCPFeature(physicalMonitors[displayId].hPhysicalMonitor, vcpCode, newValue);
if (!success)
if (!success) {
std::cerr << "Failed to set vcp feature" << std::endl;
return success;
return 1;
}
return 0;
}

std::unordered_map<std::string, std::function<int(std::vector<std::string>)>> commands
Expand Down

0 comments on commit 7f08f36

Please sign in to comment.