[gimp/gimpmetadata-new-wip] plug-ins: fix file mode attribute again Both O_BINARY and O_BINARY are not defined in linux by defau
- From: Hartmut Kuhse <hartmutkuhse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimpmetadata-new-wip] plug-ins: fix file mode attribute again Both O_BINARY and O_BINARY are not defined in linux by defau
- Date: Thu, 5 Jan 2017 20:40:12 +0000 (UTC)
commit a2668a8fdde4829803050e1538cd95135ce2a0de
Author: Hartmut Kuhse <hk_priv gmx de>
Date: Thu Jan 5 21:39:49 2017 +0100
plug-ins: fix file mode attribute again
Both O_BINARY and O_BINARY are not defined in linux by default.
So it needs a local #define.
plug-ins/common/attributes.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/common/attributes.c b/plug-ins/common/attributes.c
index 9be4afe..3eb69f5 100644
--- a/plug-ins/common/attributes.c
+++ b/plug-ins/common/attributes.c
@@ -42,6 +42,10 @@
#include <glib/gstdio.h>
#include <gio/gio.h>
+#ifndef _O_BINARY
+#define _O_BINARY 0
+#endif
+
#ifdef G_OS_WIN32
#include <io.h>
#endif
@@ -890,11 +894,9 @@ attributes_export_dialog_response (GtkWidget *dlg,
buffer = g_string_new (xmp_data);
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
-#ifdef G_OS_WIN32
+
fd = g_open (filename, O_CREAT | O_TRUNC | O_WRONLY | _O_BINARY, 0666);
-#else
- fd = g_open (filename, O_CREAT | O_TRUNC | O_WRONLY, 0666);
-#endif
+
if (fd < 0)
{
attributes_message_dialog (GTK_MESSAGE_ERROR, GTK_WINDOW (dlg),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]