From 972bbd35addefa0b0152397fb52a3895f8f4084a Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Wed, 25 Sep 2013 09:43:27 +0100
Subject: [PATCH] ENH: wmkdep: improved error message

---
 wmake/src/wmkdep.l | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l
index 86c6f64e939..d9d4b73591b 100644
--- a/wmake/src/wmkdep.l
+++ b/wmake/src/wmkdep.l
@@ -3,7 +3,7 @@
  =========                   |
  \\      /   F ield          | OpenFOAM: The Open Source CFD Toolbox
   \\    /    O peration      |
-   \\  /     A nd            | Copyright (C) 2011 OpenFOAM Foundation
+   \\  /     A nd            | Copyright (C) 2011-2013 OpenFOAM Foundation
     \\/      M anipulation   |
 ------------------------------------------------------------------------------
 License
@@ -333,12 +333,24 @@ void nextFile(const char* fileName)
             free(pathName);
         }
 
-        fprintf
-        (
-            stderr,
-            "could not open file %s for source file %s\n",
-            fileName, sourceFile
-        );
+        if (nDirectories == 0)
+        {
+            fprintf
+            (
+                stderr,
+                "could not open file %s for source file %s\n",
+                fileName, sourceFile
+            );
+        }
+        else
+        {
+            fprintf
+            (
+                stderr,
+                "could not open file %s for source file %s due to %s\n",
+                fileName, sourceFile, strerror(errno)
+            );
+        }
 
         fflush(stdout);
         fflush(stderr);
-- 
GitLab