From 5d8f8e2953a8e246de6247a8125609e95dc25005 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Tue, 9 Jan 2018 20:59:05 +0100 Subject: [PATCH] Some Linux compile fixes. --- Makefile | 2 +- src/compat.h | 2 -- src/main++.cpp | 2 +- src/main.c | 2 +- src/utilities.h | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4de0a91..40ab73a 100644 --- 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 diff --git a/src/compat.h b/src/compat.h index 3d4aeb5..c6559ea 100644 --- a/src/compat.h +++ b/src/compat.h @@ -65,12 +65,10 @@ #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 diff --git a/src/main++.cpp b/src/main++.cpp index 44f9263..bb51812 100644 --- a/src/main++.cpp +++ b/src/main++.cpp @@ -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); diff --git a/src/main.c b/src/main.c index 5e224b6..b6ada85 100644 --- a/src/main.c +++ b/src/main.c @@ -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); diff --git a/src/utilities.h b/src/utilities.h index 764ba40..4f80eb2 100644 --- a/src/utilities.h +++ b/src/utilities.h @@ -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*/ -- 2.11.0