Convert CRYPTO_LOCK_UI to new multi-threading API
[openssl.git] / crypto / ui / ui_openssl.c
index 2ee9658d7249f49c0ffd84517807d8b2039a332c..9a4870803ecb461afc322228d757a6944e77febb 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/ui/ui_openssl.c -*- mode:C; c-file-style: "eay" -*- */
 /*
  * Written by Richard Levitte (richard@levitte.org) and others for the
  * OpenSSL project 2001.
 
 /* 06-Apr-92 Luke Brennan    Support for VMS */
 #include "ui_locl.h"
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 
 #ifdef OPENSSL_SYS_VMS          /* prototypes for sys$whatever */
 # include <starlet.h>
@@ -463,7 +462,7 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
 /* Internal functions to open, handle and close a channel to the console.  */
 static int open_console(UI *ui)
 {
-    CRYPTO_w_lock(CRYPTO_LOCK_UI);
+    CRYPTO_THREAD_write_lock(ui->lock);
     is_a_tty = 1;
 
 #if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
@@ -570,7 +569,7 @@ static int close_console(UI *ui)
 #ifdef OPENSSL_SYS_VMS
     status = sys$dassgn(channel);
 #endif
-    CRYPTO_w_unlock(CRYPTO_LOCK_UI);
+    CRYPTO_THREAD_unlock(ui->lock);
 
     return 1;
 }
@@ -585,7 +584,7 @@ static void pushsig(void)
 # ifdef SIGACTION
     struct sigaction sa;
 
-    memset(&sa, 0, sizeof sa);
+    memset(&sa, 0, sizeof(sa));
     sa.sa_handler = recsig;
 # endif