comparison src/c/openssl.c @ 2250:c275bbc41194

Start work on pure expression caching.
author Ziv Scully <ziv@mit.edu>
date Sun, 13 Sep 2015 16:02:45 -0400
parents 8a01e8f21de9
children dfadb5effdc0
comparison
equal deleted inserted replaced
2249:c05851bf7861 2250:c275bbc41194
33 } 33 }
34 } 34 }
35 35
36 // OpenSSL callbacks 36 // OpenSSL callbacks
37 static void thread_id(CRYPTO_THREADID *const result) { 37 static void thread_id(CRYPTO_THREADID *const result) {
38 CRYPTO_THREADID_set_numeric(result, pthread_self()); 38 CRYPTO_THREADID_set_numeric(result, (unsigned long)pthread_self());
39 } 39 }
40 static void lock_or_unlock(const int mode, const int type, const char *file, 40 static void lock_or_unlock(const int mode, const int type, const char *file,
41 const int line) { 41 const int line) {
42 pthread_mutex_t *const lock = &openssl_locks[type]; 42 pthread_mutex_t *const lock = &openssl_locks[type];
43 if (mode & CRYPTO_LOCK) { 43 if (mode & CRYPTO_LOCK) {
71 if (uw_sig_file) { 71 if (uw_sig_file) {
72 int fd; 72 int fd;
73 73
74 if (access(uw_sig_file, F_OK)) { 74 if (access(uw_sig_file, F_OK)) {
75 random_password(); 75 random_password();
76 76
77 if ((fd = open(uw_sig_file, O_WRONLY | O_CREAT, 0700)) < 0) { 77 if ((fd = open(uw_sig_file, O_WRONLY | O_CREAT, 0700)) < 0) {
78 fprintf(stderr, "Can't open signature file %s\n", uw_sig_file); 78 fprintf(stderr, "Can't open signature file %s\n", uw_sig_file);
79 perror("open"); 79 perror("open");
80 exit(1); 80 exit(1);
81 } 81 }