Skip to content

Commit

Permalink
Merge pull request #1 from createyourpersonalaccount/fix-cpp-logic
Browse files Browse the repository at this point in the history
fix preprocessor logic with HAVE_STAT
  • Loading branch information
bradh352 authored Jan 28, 2025
2 parents 221e340 + b72908d commit f0f08ed
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib/crypto/ares_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,11 @@ static ares_bool_t file_exists(const char *path, ares_bool_t is_directory)
{
# ifdef HAVE_STAT
struct stat st;
if (stat(filename, &st) != 0) {
return ARES_FALSE;
}
# elif defined(_WIN32)
struct _stat st;
if (_stat(filename, &st) != 0) {
if (stat(path, &st) != 0) {
return ARES_FALSE;
}
# else
# error "Need stat() function for crypto subsystem with OpenSSL."
# endif
if (is_directory) {
if (st.st_mode & S_IFDIR) {
Expand Down

0 comments on commit f0f08ed

Please sign in to comment.