]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost12sum.c
tcl_tests: ca.try: Ignore openssl crl exit status for 'corrupted CRL' test
[openssl-gost/engine.git] / gost12sum.c
index 33482a490772a510c338fd5fc1f7323480796158..e644a613b1285dda78f896eb4e220e8a0b287da7 100644 (file)
  **********************************************************************/
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef _MSC_VER
+#include "getopt.h"
+# ifndef PATH_MAX
+#  define PATH_MAX _MAX_PATH
+# endif
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#else
 #include <unistd.h>
+#endif
 #include <limits.h>
 #include <fcntl.h>
+#ifdef _WIN32
+# include <io.h>
+#endif
 #include <string.h>
 #include "gosthash2012.h"
 #define BUF_SIZE 262144
@@ -209,6 +221,7 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode,
     }
     if (!hash_stream(ctx, fd, sum, hashsize)) {
         perror(filename);
+        close(fd);
         return 0;
     }
     close(fd);