Remove 'pipex' from my pbd.vcproj as it's not needed for Ardour3
[ardour.git] / libs / pbd / sndfile_manager.cc
index c53778ac0d33daeca392c85b6dbbe7cd46fd0b6f..c028bc11bacae12e47c33b413c7268f14e0dbd36 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include <sys/time.h>
-#include <sys/resource.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include "pbd/sndfile_manager.h"
 #include "pbd/debug.h"
 
-/*
- * Neat solution to the Win32/OS2 binary file flage requirement.
- * If O_BINARY isn't already defined by the inclusion of the system
- * headers, set it to zero.
- */
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-
 using namespace std;
 using namespace PBD;
 
@@ -99,32 +88,8 @@ bool
 SndFileDescriptor::open ()
 {
        /* we must have a lock on the FileManager's mutex */
-
-       int fd, oflag, mode ;
-
-       if (_writeable) {
-               oflag = O_RDWR | O_CREAT | O_BINARY ;
-               mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ;
-       } else {
-               oflag = O_RDONLY | O_BINARY ;
-               mode = 0 ;
-       }
-
-       if (mode == 0) {
-               fd = ::open (_path.c_str(), oflag) ;
-       } else {
-               fd = ::open (_path.c_str(), oflag, mode) ;
-       }
-
-       if (fd == -1) return false;
-       fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
-
-       _sndfile = sf_open_fd (fd, _writeable ? SFM_RDWR : SFM_READ, _info, 1);
-
-       if (_sndfile == 0) {
-               ::close(fd);
-       }
-
+       
+       _sndfile = sf_open (_path.c_str(), _writeable ? SFM_RDWR : SFM_READ, _info);
        return (_sndfile == 0);
 }