Conversation
83b19d2 to
69f2c2c
Compare
e58ad88 to
ac0c062
Compare
ac0c062 to
6c31b5a
Compare
arogge
left a comment
There was a problem hiding this comment.
I had a deeper look at all of this and it is really not that easy :(
The BErrNo is supposed to handle errno, Windows Error Codes and BPipe return values. Now on Windows you need to know if the function you just called was a a WinAPI function that sets a Windows Error Code or it was a C runtime function that sets errno.
In fact, to make this work correctly, you'd have to tell BErrNo what kind of error you were expecting, which is what the magic b_errno_win32 was supposed to do.
I guess to make this work, we will have to sit down and discuss our options. Right now I don't see any easy way to make this work reliably.
6c31b5a to
1ae9b4c
Compare
19baf0b to
16f6733
Compare
16f6733 to
10e42d2
Compare
c4250c8 to
32abcd2
Compare
arogge
left a comment
There was a problem hiding this comment.
The result looks fine. I would like to see fewer commits for this. It is probably readonable to make it one for the code changes, one for the unit test and the CHANGELOG.md.
I think we can merge it then.
32abcd2 to
9022939
Compare
certain windows errors do not have a message to accompany them! The `formatMessage()` function returns an empty string when called for an error that does not have a registered message. Basically, not all error strings are defined in the system message table. So the change that was made was to make sure that if the error message does not exist, at least the error code is returned to the user so they can search for the appropriate error reason somewhere else
The errors would not use the necessary windows code when `b_errno_win32` is not set. And so, the program automatically tries to search for a Linux interpretation of the error code, which would lead to a wrong/non-existant message for that error code. Windows and Linux error codes are different and only have a few common error codes like `0` for `success` or error `2` for `no such file a directory`. This change makes sure that, when in doubt, just show both messages and let the user interpret the error code provided.
9022939 to
04db254
Compare
Description
Error messages using
berrnodo not work properly on windows. This PR fixes the issue.Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
General
Source code quality
bareos-check-sources --since-mergedoes not report any problemsgit statusshould not report modifications in the source tree after building and testingTests