Skip to content

Commit

Permalink
Add error details to rotation error message (jakehilborn#57)
Browse files Browse the repository at this point in the history
If screen rotation fails, the user is not given any information why it failed. This commit adds the mach error string and code to the error message.
Example output:
Error rotating screen 74F4484D-FF93-DFFA-0857-D6964E3302DB: (ipc/send) invalid destination port, code: 0x10000003
  • Loading branch information
jiinurppa authored Jul 17, 2022
1 parent bcfdfa3 commit 7f57445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion displayplacer.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ bool rotateScreen(CGDirectDisplayID screenId, char* screenUUID, int degree) {
int retVal = IOServiceRequestProbe(service, options);

if (retVal != 0) {
fprintf(stderr, "Error rotating screen %s\n", screenUUID);
fprintf(stderr, "Error rotating screen %s: %s, code: 0x%x\n", screenUUID, mach_error_string(retVal), retVal);
return false;
}

Expand Down

0 comments on commit 7f57445

Please sign in to comment.