Fix strange formatting by indent
[oweals/openssl.git] / crypto / x509 / by_dir.c
index f33ea7b84f2529a683bb6bded6d9be179253a01d..671bd81d27ba42db9d7acdbd27e8133a1ff84eb2 100644 (file)
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
 
+#ifdef _WIN32
+#define stat   _stat
+#endif
+
 typedef struct lookup_dir_st
        {
        BUF_MEM *buffer;
@@ -198,7 +202,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
                        len=(int)(p-ss);
                        if (len == 0) continue;
                        for (j=0; j<ctx->num_dirs; j++)
-                               if (strlen(ctx->dirs[j]) == len &&
+                               if (strlen(ctx->dirs[j]) == (size_t)len &&
                                    strncmp(ctx->dirs[j],ss,(unsigned int)len) == 0)
                                        break;
                        if (j<ctx->num_dirs)
@@ -356,11 +360,11 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
 
                /* we have added it to the cache so now pull
                 * it out again */
-               CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
+               CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
                j = sk_X509_OBJECT_find(xl->store_ctx->objs,&stmp);
                if(j != -1) tmp=sk_X509_OBJECT_value(xl->store_ctx->objs,j);
                else tmp = NULL;
-               CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
+               CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
 
                if (tmp != NULL)
                        {
@@ -370,7 +374,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
                        /* If we were going to up the reference count,
                         * we would need to do it on a perl 'type'
                         * basis */
-       /*              CRYPTO_add(&tmp->data.x509->references,1,
+       /*-             CRYPTO_add(&tmp->data.x509->references,1,
                                CRYPTO_LOCK_X509);*/
                        goto finish;
                        }
@@ -379,4 +383,3 @@ finish:
        if (b != NULL) BUF_MEM_free(b);
        return(ok);
        }
-