X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost12sum.c;h=e644a613b1285dda78f896eb4e220e8a0b287da7;hb=HEAD;hp=33482a490772a510c338fd5fc1f7323480796158;hpb=395855c3dbc160c623311ec608d1acbb688f8eda;p=openssl-gost%2Fengine.git diff --git a/gost12sum.c b/gost12sum.c index 33482a4..e644a61 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -10,9 +10,21 @@ **********************************************************************/ #include #include +#ifdef _MSC_VER +#include "getopt.h" +# ifndef PATH_MAX +# define PATH_MAX _MAX_PATH +# endif +#include +typedef SSIZE_T ssize_t; +#else #include +#endif #include #include +#ifdef _WIN32 +# include +#endif #include #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);