Skip to content

Commit

Permalink
Merge pull request #12 from toy/no-idle-sleep-wording
Browse files Browse the repository at this point in the history
mention sleep in idle assertion message and variable name
  • Loading branch information
rentzsch authored Sep 6, 2021
2 parents 44b0627 + a26f1b2 commit 52f90e2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions stressdrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ int main(int argc, const char *argv[]) {
uint16_t bufferBlocks = bufferSize / blockSize;

#ifdef __APPLE__
IOPMAssertionID noIdleAssertionID;
IOReturn noIdleAssertionCreated = IOPMAssertionCreateWithName(
IOPMAssertionID noIdleSleepAssertionID;
IOReturn noIdleSleepAssertionCreated = IOPMAssertionCreateWithName(
kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn,
CFSTR("stressdrive running"), &noIdleAssertionID);
if (kIOReturnSuccess == noIdleAssertionCreated) {
printf("succesfully created no idle assertion\n");
CFSTR("stressdrive running"), &noIdleSleepAssertionID);
if (kIOReturnSuccess == noIdleSleepAssertionCreated) {
printf("succesfully created no idle sleep assertion\n");
} else {
printf("failed to create no idle assertion\n");
printf("failed to create no idle sleep assertion\n");
}
#endif

Expand Down Expand Up @@ -283,11 +283,11 @@ int main(int argc, const char *argv[]) {
}

#ifdef __APPLE__
if (kIOReturnSuccess == noIdleAssertionCreated) {
if (kIOReturnSuccess == IOPMAssertionRelease(noIdleAssertionID)) {
printf("succesfully released no idle assertion\n");
if (kIOReturnSuccess == noIdleSleepAssertionCreated) {
if (kIOReturnSuccess == IOPMAssertionRelease(noIdleSleepAssertionID)) {
printf("succesfully released no idle sleep assertion\n");
} else {
printf("failed to release no idle assertion\n");
printf("failed to release no idle sleep assertion\n");
}
}
#endif
Expand Down

0 comments on commit 52f90e2

Please sign in to comment.