Skip to content

Conversation

ilya071294
Copy link
Contributor

The fix is needed to avoid potential problems in Firebird QA.

… fix cases when it's not reloaded after modification/replacement

The fix is needed to avoid potential problems in Firebird QA.
@aafemt
Copy link
Contributor

aafemt commented May 5, 2025

Wouldn't it be better to make Windows version of getTime to return timespec and unify the rest of code?

Also it is simpler to use GetFileAttributesEx than FindFirstFile.

@ilya071294
Copy link
Contributor Author

Wouldn't it be better to make Windows version of getTime to return timespec and unify the rest of code?

I can do that if conversion to timespec on every checkLoadConfig call is appropriate. @AlexPeshkoff What do you think?

Also it is simpler to use GetFileAttributesEx than FindFirstFile.

Done.

@aafemt
Copy link
Contributor

aafemt commented May 6, 2025

I can do that if conversion to timespec on every checkLoadConfig call is appropriate.

IIRC this "conversion" is a couple of multiplication.

@dyemanov
Copy link
Member

@AlexPeshkoff do you have any objections to this change?

@AlexPeshkoff
Copy link
Member

Do something like this:
namespace Firebird {
class PreciseTime
{
public:
PreciseTime() : high(0), low(0) {}
#ifdef WIN_NT
PreciseTime(//Windows specific ctor
#else
PreciseTime(//Posix specific ctor
#endif

operator=(const PreciseTime&) = default;

private:
time_t high;
unsigned low;
};
} // namespace

Next:
Firebird::PreciseTime ConfigCache::File::getTime();

And return PreciseTime from that function - code around remains as clear as it was before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants