OSDN Git Service

Some Linux compile fixes.
authorLoRd_MuldeR <mulder2@gmx.de>
Tue, 9 Jan 2018 19:59:05 +0000 (20:59 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Tue, 9 Jan 2018 19:59:05 +0000 (20:59 +0100)
Makefile
src/compat.h
src/main++.cpp
src/main.c
src/utilities.h

index 4de0a91..40ab73a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
 WORK_DIR := /tmp/$(shell head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12)
 ISO_DATE := $(shell date "+%Y-%m-%d")
 
-CM_FLAGS := -I$(ROOT_DIR)/include -D_GNU_SOURCE
+CM_FLAGS := -I$(ROOT_DIR)/include
 RL_FLAGS := -DNDEBUG -O3 -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
 DB_FLAGS := -g
 EX_FLAGS := -static
index 3d4aeb5..c6559ea 100644 (file)
 #define fstat64 _fstat64
 #define FILENO(X) _fileno((X))
 #define SETMODE(X,Y) _setmode(_fileno((X)), (Y) ? _O_BINARY : _O_U8TEXT)
-#define FCLOSEALL() _fcloseall()
 #define FORCE_EXIT(X) _exit((X))
 #else
 #define FILENO(X) fileno((X))
 #define SETMODE(X,Y) ((void)0)
-#define FCLOSEALL() fcloseall()
 #define FORCE_EXIT(X) _Exit((X))
 #endif
 
index 44f9263..bb51812 100644 (file)
@@ -86,7 +86,7 @@ static int process_file(const int multi_file, const param_t *const param, uint64
        }
 
        /*check file error status*/
-       if (ferror(source))
+       if ((!g_interrupted) && ferror(source))
        {
                print_logo();
                FPUTS(T("File read error has occurred!\n"), stderr);
index 5e224b6..b6ada85 100644 (file)
@@ -87,7 +87,7 @@ static int process_file(const int multi_file, const param_t *const param, uint64
        }
 
        /*check file error status*/
-       if (ferror(source))
+       if ((!g_interrupted) && ferror(source))
        {
                print_logo();
                FPUTS(T("File read error has occurred!\n"), stderr);
index 764ba40..4f80eb2 100644 (file)
@@ -282,7 +282,7 @@ static void sigint_handler(int sig_no)
 {
        g_interrupted = 1;
        signal(sig_no, sigint_handler);
-       FCLOSEALL();
+       fclose(stdin);
 }
 
 #endif /*MHASH_CLI_UTILS_INCLUDED*/