aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-20 06:59:25 +0200
committerMax Kellermann <max@duempel.org>2010-05-20 09:13:39 +0200
commitc727e8698020f69516cb62e001ac6f8254025fe1 (patch)
tree925ec857d42dc44b743a31de36691b64e59914b0 /src/output
parent57b4013306c18a1c510d00845a9915bea0bcf525 (diff)
downloadmpd-c727e8698020f69516cb62e001ac6f8254025fe1.tar.gz
mpd-c727e8698020f69516cb62e001ac6f8254025fe1.tar.xz
mpd-c727e8698020f69516cb62e001ac6f8254025fe1.zip
input/file, output/{fifo,recorder}: add O_BINARY to open() flags
Windows compatibility.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/fifo_output_plugin.c6
-rw-r--r--src/output/recorder_output_plugin.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/output/fifo_output_plugin.c b/src/output/fifo_output_plugin.c
index a92c689f9..f4217ec4d 100644
--- a/src/output/fifo_output_plugin.c
+++ b/src/output/fifo_output_plugin.c
@@ -22,12 +22,12 @@
#include "utils.h"
#include "timer.h"
#include "fd_util.h"
+#include "open.h"
#include <glib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
@@ -154,7 +154,7 @@ fifo_open(struct fifo_data *fd, GError **error)
if (!fifo_check(fd, error))
return false;
- fd->input = open_cloexec(fd->path, O_RDONLY|O_NONBLOCK, 0);
+ fd->input = open_cloexec(fd->path, O_RDONLY|O_NONBLOCK|O_BINARY, 0);
if (fd->input < 0) {
g_set_error(error, fifo_output_quark(), errno,
"Could not open FIFO \"%s\" for reading: %s",
@@ -163,7 +163,7 @@ fifo_open(struct fifo_data *fd, GError **error)
return false;
}
- fd->output = open_cloexec(fd->path, O_WRONLY|O_NONBLOCK, 0);
+ fd->output = open_cloexec(fd->path, O_WRONLY|O_NONBLOCK|O_BINARY, 0);
if (fd->output < 0) {
g_set_error(error, fifo_output_quark(), errno,
"Could not open FIFO \"%s\" for writing: %s",
diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c
index ce69a5116..c01d927c4 100644
--- a/src/output/recorder_output_plugin.c
+++ b/src/output/recorder_output_plugin.c
@@ -22,11 +22,11 @@
#include "encoder_plugin.h"
#include "encoder_list.h"
#include "fd_util.h"
+#include "open.h"
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@@ -158,7 +158,8 @@ recorder_output_open(void *data, struct audio_format *audio_format,
/* create the output file */
- recorder->fd = open_cloexec(recorder->path, O_CREAT|O_WRONLY|O_TRUNC,
+ recorder->fd = open_cloexec(recorder->path,
+ O_CREAT|O_WRONLY|O_TRUNC|O_BINARY,
0666);
if (recorder->fd < 0) {
g_set_error(error_r, recorder_output_quark(), 0,