From 544be3ebe8afb2a45b8c9855d9777b29ad22f43b Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 25 Jul 2015 20:52:52 +1000 Subject: Use g_open instead of ::open in AudioSource for portability This is only really for Windows as g_open and ::open are the same thing on other platforms --- libs/ardour/audiosource.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/ardour/audiosource.cc') diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index cf36a9155e..d9e7c938b9 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -392,7 +392,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t } } - ScopedFileDescriptor sfd (::open (peakpath.c_str(), O_RDONLY)); + ScopedFileDescriptor sfd (g_open (peakpath.c_str(), O_RDONLY, 0444)); if (sfd < 0) { error << string_compose (_("Cannot open peakfile @ %1 for reading (%2)"), peakpath, strerror (errno)) << endmsg; @@ -775,7 +775,7 @@ AudioSource::build_peaks_from_scratch () int AudioSource::prepare_for_peakfile_writes () { - if ((_peakfile_fd = open (peakpath.c_str(), O_CREAT|O_RDWR, 0664)) < 0) { + if ((_peakfile_fd = g_open (peakpath.c_str(), O_CREAT|O_RDWR, 0664)) < 0) { error << string_compose(_("AudioSource: cannot open peakpath (c) \"%1\" (%2)"), peakpath, strerror (errno)) << endmsg; return -1; } -- cgit v1.2.3