From 702a38f43882dce419751913907d6c714f9336ba Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 21 Jul 2016 15:42:10 +0100 Subject: [PATCH] [many tools] fix bug in previous patch --- base/output_file_requirements.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/base/output_file_requirements.cc b/base/output_file_requirements.cc index 001e127..fefdc0f 100644 --- a/base/output_file_requirements.cc +++ b/base/output_file_requirements.cc @@ -37,14 +37,17 @@ base::check_output_file_requirements(string const &path) explain_output_file_requirements(); } - if (!info.st_size) { - cerr << "Zero size output file.\n\n"; - explain_output_file_requirements(); - } + // We only really want these checks for regular files + if (S_ISREG(info.st_mode)) { + if (!info.st_size) { + cerr << "Zero size output file.\n\n"; + explain_output_file_requirements(); + } - if (info.st_size < MIN_SIZE) { - cerr << "Output file too small.\n\n"; - explain_output_file_requirements(); + if (info.st_size < MIN_SIZE) { + cerr << "Output file too small.\n\n"; + explain_output_file_requirements(); + } } }