diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-12-10 13:55:53 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-12-10 13:55:53 -0500 |
commit | 611302d61006f21cff5b314426474a52167054aa (patch) | |
tree | 2b8511bc63ed0034c04221cd0730371887cdae3c | |
parent | a0fcf2fc66c255a0bf7c1b4bb544c1d3d594cb3a (diff) |
O_DIRECT makes no sense in this test because it requires page/block-sized writes
-rw-r--r-- | tools/sftest.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/sftest.cc b/tools/sftest.cc index 19d0cc5530..772fc3fd43 100644 --- a/tools/sftest.cc +++ b/tools/sftest.cc @@ -5,6 +5,8 @@ #include <iomanip> #include <sstream> #include <cstdlib> +#include <cerrno> + #include <unistd.h> #include <sndfile.h> #include <stdint.h> @@ -174,17 +176,10 @@ main (int argc, char* argv[]) path = Glib::build_filename (tmpdirname, ss.str()); int flags = O_RDWR|O_CREAT|O_TRUNC; - -#ifndef __APPLE__ - if (direct) { - flags |= O_DIRECT; - } -#endif - int fd = open (path.c_str(), flags, 0644); if (fd < 0) { - cerr << "Could not open file #" << n << " @ " << path << endl; + cerr << "Could not open file #" << n << " @ " << path << " (" << strerror (errno) << ")" << endl; return 1; } @@ -200,7 +195,7 @@ main (int argc, char* argv[]) } #endif if ((sf = sf_open_fd (fd, SFM_RDWR, &format_info, true)) == 0) { - cerr << "Could not open file #" << n << " @ " << path << endl; + cerr << "Could not open SNDFILE #" << n << " @ " << path << " (" << sf_strerror (0) << ")" << endl; return 1; } |