[libbluray-devel] file: log failures when closing file
hpi1
git at videolan.org
Sun May 15 15:44:38 CEST 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun May 15 15:58:41 2016 +0300| [607ed40c3cb8ec2d09cdc9b1640bd07f4bb1baa4] | committer: hpi1
file: log failures when closing file
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=607ed40c3cb8ec2d09cdc9b1640bd07f4bb1baa4
---
src/file/file_posix.c | 4 +++-
src/file/file_win32.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/file/file_posix.c b/src/file/file_posix.c
index 2a79f6f..032e763 100644
--- a/src/file/file_posix.c
+++ b/src/file/file_posix.c
@@ -48,7 +48,9 @@
static void _file_close(BD_FILE_H *file)
{
if (file) {
- close((int)(intptr_t)file->internal);
+ if (close((int)(intptr_t)file->internal)) {
+ BD_DEBUG(DBG_CRIT | DBG_FILE, "Error closing POSIX file (%p)\n", (void*)file);
+ }
BD_DEBUG(DBG_FILE, "Closed POSIX file (%p)\n", (void*)file);
diff --git a/src/file/file_win32.c b/src/file/file_win32.c
index 5eb52d7..6c9123f 100644
--- a/src/file/file_win32.c
+++ b/src/file/file_win32.c
@@ -40,7 +40,9 @@
static void _file_close(BD_FILE_H *file)
{
if (file) {
- fclose((FILE *)file->internal);
+ if (fclose((FILE *)file->internal)) {
+ BD_DEBUG(DBG_FILE | DBG_CRIT, "Error closing WIN32 file (%p)\n", (void*)file);
+ }
BD_DEBUG(DBG_FILE, "Closed WIN32 file (%p)\n", (void*)file);
More information about the libbluray-devel
mailing list