From b25ed9dfb2d7c5c4e39b7d26ef033e6744022f00 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Fri, 4 Jan 2019 20:10:56 +0100 Subject: Replaced calls to perror() by logging when loading file contents. --- src/analysis/contents/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/analysis/contents/file.c b/src/analysis/contents/file.c index 6b55840..5beb0e3 100644 --- a/src/analysis/contents/file.c +++ b/src/analysis/contents/file.c @@ -35,6 +35,7 @@ #include "../content-int.h" #include "../../common/extstr.h" #include "../../common/pathname.h" +#include "../../core/logs.h" @@ -285,7 +286,7 @@ GBinContent *g_file_content_new(const char *filename) fd = open(filename, O_RDONLY); if (fd == -1) { - perror("open"); + LOG_ERROR_N("open"); goto gbcnff_error; } @@ -293,7 +294,7 @@ GBinContent *g_file_content_new(const char *filename) if (ret == -1) { close(fd); - perror("fstat"); + LOG_ERROR_N("fstat"); goto gbcnff_error; } @@ -301,7 +302,7 @@ GBinContent *g_file_content_new(const char *filename) if (content == MAP_FAILED) { close(fd); - perror("mmap"); + LOG_ERROR_N("mmap"); goto gbcnff_error; } -- cgit v0.11.2-87-g4458