diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-16 13:34:29 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-16 13:34:35 -0500 |
commit | 5188f02cfee77ce0a6f91eb6023690b42863c92c (patch) | |
tree | 2fce4f54bd9a8a5882cdfc54da6d01247c4663ab /libs/pbd/file_utils.cc | |
parent | 3a1071e5e98f5ae632319c780209783a1f173bee (diff) |
hide issues with g_close() not being available in somewhat older versions of glib
Diffstat (limited to 'libs/pbd/file_utils.cc')
-rw-r--r-- | libs/pbd/file_utils.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 804f825b94..25d675932b 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -491,10 +491,8 @@ toggle_file_existence (string const & path) return g_unlink (path.c_str()); } - int fd = g_open (path.c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666); - GError* err; - g_close (fd, &err); - return !(fd >= 0); + PBD::ScopedFileDescriptor fd = g_open (path.c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666); + return !((int) fd >= 0); } } // namespace PBD |