From 8dc8c510c13b8ff5692f497004c818f2b6dfeb41 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 12 Feb 2003 06:10:19 +0000 Subject: [PATCH] r4018: Auto commit for Debian build --- debian/changelog | 6 ++++++ wdq2wav.cpp | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index ea5c13f..1380766 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wdq2wav (0.3.2-1) unstable; urgency=low + + * New upstream, fix for opening binary files with cygwin + + -- Kevin M. Rosenberg Tue, 11 Feb 2003 23:06:52 -0700 + wdq2wav (0.3.1-1) unstable; urgency=low * Update manpage diff --git a/wdq2wav.cpp b/wdq2wav.cpp index ff0430a..392a108 100644 --- a/wdq2wav.cpp +++ b/wdq2wav.cpp @@ -8,7 +8,7 @@ ** ** Copyright (c) 2003 Kevin Rosenberg ** -** $Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $ +** $Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -26,12 +26,18 @@ #include -const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $"; +const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $"; bool g_quiet = false; bool g_verbose = false; bool g_debug = false; +// Define as NULL for non-Windows platforms +#ifndef O_BINARY +#define O_BINARY 0 +#endif + + void error_msg (const char *msg) { @@ -306,7 +312,7 @@ WindaqFile::ReadHeader () unsigned short int tmp2; m_valid = false; - if ((m_fd = open (m_strFile.c_str(), O_RDONLY)) < 0) { + if ((m_fd = open (m_strFile.c_str(), O_RDONLY | O_BINARY)) < 0) { m_error = "Unable to open file"; return false; } @@ -607,7 +613,7 @@ WavFile::WriteFile () return false; if (m_fd == 0) - if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_TRUNC | O_CREAT, + if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_BINARY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == 0) { std::ostringstream os; os << "Error opening output file " << m_strFile.c_str(); -- 2.34.1