pkcs11-tool: #407: on Windows use O_BINARY open file mode
https://www.opensc-project.org/opensc/ticket/407 http://msdn.microsoft.com/en-us/library/ee2849wt%28v=VS.71%29.aspx
This commit is contained in:
parent
dfbc3996bf
commit
7e42c6d97d
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef ENABLE_OPENSSL
|
#ifdef ENABLE_OPENSSL
|
||||||
#include <openssl/opensslv.h>
|
#include <openssl/opensslv.h>
|
||||||
|
@ -374,6 +375,11 @@ int main(int argc, char * argv[])
|
||||||
int action_count = 0;
|
int action_count = 0;
|
||||||
CK_RV rv;
|
CK_RV rv;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (_set_fmode(_O_BINARY) == EINVAL)
|
||||||
|
util_fatal("Cannot set FMODE to O_BINARY");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_OPENSSL
|
#ifdef ENABLE_OPENSSL
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
|
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
|
||||||
OPENSSL_config(NULL);
|
OPENSSL_config(NULL);
|
||||||
|
|
Loading…
Reference in New Issue