From 8a9cba471fe49fd73342ee0b7a898f29539edb20 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Wed, 1 Mar 2017 18:04:15 +0300
Subject: Add logging info about mount / unmount in physfs.

---
 src/fs/physfs/virtfsphys.cpp | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

(limited to 'src/fs/physfs/virtfsphys.cpp')

diff --git a/src/fs/physfs/virtfsphys.cpp b/src/fs/physfs/virtfsphys.cpp
index 3cb044277..0d474b161 100644
--- a/src/fs/physfs/virtfsphys.cpp
+++ b/src/fs/physfs/virtfsphys.cpp
@@ -187,8 +187,14 @@ namespace VirtFsPhys
             reportAlways("Called addDirToSearchPath with zip archive");
             return false;
         }
-        return PHYSFS_addToSearchPath(newDir.c_str(),
+        const int ret = PHYSFS_addToSearchPath(newDir.c_str(),
             append == Append_true ? 1 : 0);
+        if (ret == 0)
+        {
+            logger->log("addDirToSearchPath error: %s",
+                VirtFsPhys::getLastError());
+        }
+        return ret;
     }
 
     bool removeDirFromSearchPath(const std::string &restrict oldDir)
@@ -199,7 +205,13 @@ namespace VirtFsPhys
             reportAlways("Called removeDirFromSearchPath with zip archive");
             return false;
         }
-        return PHYSFS_removeFromSearchPath(oldDir.c_str());
+        const int ret = PHYSFS_removeFromSearchPath(oldDir.c_str());
+        if (ret == 0)
+        {
+            logger->log("removeDirFromSearchPath error: %s",
+                VirtFsPhys::getLastError());
+        }
+        return ret;
     }
 
     bool addZipToSearchPath(const std::string &restrict newDir,
@@ -211,8 +223,14 @@ namespace VirtFsPhys
             reportAlways("Called addZipToSearchPath without zip archive");
             return false;
         }
-        return PHYSFS_addToSearchPath(newDir.c_str(),
+        const int ret = PHYSFS_addToSearchPath(newDir.c_str(),
             append == Append_true ? 1 : 0);
+        if (ret == 0)
+        {
+            logger->log("addZipToSearchPath error: %s",
+                VirtFsPhys::getLastError());
+        }
+        return ret;
     }
 
     bool removeZipFromSearchPath(const std::string &restrict oldDir)
@@ -223,7 +241,13 @@ namespace VirtFsPhys
             reportAlways("Called removeZipFromSearchPath without zip archive");
             return false;
         }
-        return PHYSFS_removeFromSearchPath(oldDir.c_str());
+        const int ret = PHYSFS_removeFromSearchPath(oldDir.c_str());
+        if (ret == 0)
+        {
+            logger->log("removeZipFromSearchPath error: %s",
+                VirtFsPhys::getLastError());
+        }
+        return ret;
     }
 
     std::string getRealDir(const std::string &restrict filename)
-- 
cgit v1.2.3-70-g09d2