[libbluray-devel] Log errors

hpi1 git at videolan.org
Thu Jun 1 10:27:42 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Jun  1 11:18:01 2017 +0300| [89e53e43a4aee87aa6d82ce4e7a3742b48eebc1b] | committer: hpi1

Log errors

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=89e53e43a4aee87aa6d82ce4e7a3742b48eebc1b
---

 src/libbluray/disc/properties.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/disc/properties.c b/src/libbluray/disc/properties.c
index 7490b8d6..0ca4a1ae 100644
--- a/src/libbluray/disc/properties.c
+++ b/src/libbluray/disc/properties.c
@@ -85,7 +85,9 @@ static int _read_prop_file(const char *file, char **data)
     if (fp) {
         file_close(fp);
     }
-    file_unlink(file);
+    if (file_unlink(file) < 0) {
+        BD_DEBUG(DBG_FILE, "Error removing invalid properties file\n");
+    }
     *data = str_dup("");
     return *data ? 0 : -1;
 }
@@ -115,7 +117,10 @@ static int _write_prop_file(const char *file, const char *data)
     file_close(fp);
 
     if (written != (int64_t)size) {
-        file_unlink(file);
+        BD_DEBUG(DBG_FILE, "Writing properties file %s failed\n", file);
+        if (file_unlink(file) < 0) {
+            BD_DEBUG(DBG_FILE, "Error removing properties file %s\n", file);
+        }
         return -1;
     }
 



More information about the libbluray-devel mailing list