Remove unnecessary stat calls from by_dir.c

If the file doesn't exist, we'll fail when we go to read it anyway. The
stat call just adds a needless ifdef here.

Change-Id: I00a52f988bc1d45622e559b496ef2293b3719863
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66011
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index d675f29..5eca97b 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -56,8 +56,6 @@
 
 #include <inttypes.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 
 #include <openssl/buf.h>
 #include <openssl/err.h>
@@ -318,18 +316,6 @@
       for (;;) {
         snprintf(b->data, b->max, "%s/%08" PRIx32 ".%s%d", ent->dir, h, postfix,
                  k);
-#ifndef OPENSSL_NO_POSIX_IO
-#if defined(_WIN32) && !defined(stat)
-#define stat _stat
-#endif
-        {
-          struct stat st;
-          if (stat(b->data, &st) < 0) {
-            break;
-          }
-        }
-#endif
-        // found one.
         if (type == X509_LU_X509) {
           if ((X509_load_cert_file(xl, b->data, ent->dir_type)) == 0) {
             break;