From 70cee3c6e5a08e9650feccfd145fc1aab8e13d64 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 15 Mar 2014 20:41:58 -0700 Subject: [PATCH] remove any dependency on stat. --- src/kernel/reports.c | 7 ++----- src/report.c | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/kernel/reports.c b/src/kernel/reports.c index 0cef0e6af..cb3fa52e4 100644 --- a/src/kernel/reports.c +++ b/src/kernel/reports.c @@ -55,7 +55,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* libc includes */ -#include #include #include #include @@ -1726,13 +1725,11 @@ static void write_script(FILE * F, const faction * f) int init_reports(void) { prepare_reports(); -#ifdef HAVE_STAT { - stat_type st; - if (stat(reportpath(), &st) == 0) + if (_access(reportpath(), 0)!=0) { return 0; + } } -#endif if (_mkdir(reportpath()) != 0) { if (errno != EEXIST) { perror("could not create reportpath"); diff --git a/src/report.c b/src/report.c index 73927cf77..415897f3a 100644 --- a/src/report.c +++ b/src/report.c @@ -96,11 +96,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#ifdef HAVE_STAT -#include -#include -#endif - extern int verbosity; extern int *storms; extern int weeks_per_month;