input/file, output/{fifo,recorder}: add O_BINARY to open() flags

Windows compatibility.
This commit is contained in:
Max Kellermann
2010-05-20 06:59:25 +02:00
parent 57b4013306
commit c727e86980
4 changed files with 49 additions and 7 deletions

@@ -21,9 +21,9 @@
#include "input/file_input_plugin.h"
#include "input_plugin.h"
#include "fd_util.h"
#include "open.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
@@ -54,7 +54,7 @@ input_file_open(const char *filename, GError **error_r)
if (!g_path_is_absolute(filename))
return false;
fd = open_cloexec(filename, O_RDONLY, 0);
fd = open_cloexec(filename, O_RDONLY|O_BINARY, 0);
if (fd < 0) {
if (errno != ENOENT && errno != ENOTDIR)
g_set_error(error_r, file_quark(), errno,