Use g_open instead of ::open in translation related utility functions
authorTim Mayberry <mojofunk@gmail.com>
Sat, 25 Jul 2015 10:58:29 +0000 (20:58 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Sat, 25 Jul 2015 13:14:51 +0000 (23:14 +1000)
This is for portability on Windows

libs/ardour/globals.cc

index fa6f833d94eb29fe64980321e4f4a7228efdf9db..fea1de2c55c4d74dcda0d4f532ca14655845a4f1 100644 (file)
@@ -37,6 +37,9 @@
 #include <errno.h>
 #include <time.h>
 
+#include <glib.h>
+#include <glib/gstdio.h>
+
 #ifdef PLATFORM_WINDOWS
 #include <windows.h> // for LARGE_INTEGER
 #endif
@@ -653,7 +656,7 @@ ARDOUR::translation_enable_path ()
 bool
 ARDOUR::translations_are_enabled ()
 {
-       int fd = ::open (ARDOUR::translation_enable_path().c_str(), O_RDONLY);
+       int fd = g_open (ARDOUR::translation_enable_path().c_str(), O_RDONLY, 0444);
 
        if (fd < 0) {
                return translate_by_default;
@@ -675,7 +678,7 @@ bool
 ARDOUR::set_translations_enabled (bool yn)
 {
        string i18n_enabler = ARDOUR::translation_enable_path();
-       int fd = ::open (i18n_enabler.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
+       int fd = g_open (i18n_enabler.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
 
        if (fd < 0) {
                return false;