[Gpa-commits] r739 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 14 14:10:04 CET 2006


Author: marcus
Date: 2006-02-14 14:10:04 +0100 (Tue, 14 Feb 2006)
New Revision: 739

Modified:
   trunk/src/ChangeLog
   trunk/src/gpgmetools.c
Log:
2006-02-14  Marcus Brinkmann  <marcus at g10code.de>

	* gpgmetools.c (O_BINARY): Define if it isn't defined by system
	headers.
	(gpa_open_output): Use open() instead of creat() and set binary
	mode.
	(gpa_open_input): Set binary mode.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-01-17 10:56:54 UTC (rev 738)
+++ trunk/src/ChangeLog	2006-02-14 13:10:04 UTC (rev 739)
@@ -1,3 +1,11 @@
+2006-02-14  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpgmetools.c (O_BINARY): Define if it isn't defined by system
+	headers.
+	(gpa_open_output): Use open() instead of creat() and set binary
+	mode.
+	(gpa_open_input): Set binary mode.
+
 2006-01-17  Werner Koch  <wk at g10code.com>
 
 	Replaced all stock buttons with plain texts for uniform

Modified: trunk/src/gpgmetools.c
===================================================================
--- trunk/src/gpgmetools.c	2006-01-17 10:56:54 UTC (rev 738)
+++ trunk/src/gpgmetools.c	2006-02-14 13:10:04 UTC (rev 739)
@@ -43,6 +43,12 @@
 #include <windows.h>
 #endif
 
+#ifndef O_BINARY
+#ifdef _O_BINARY
+#define O_BINARY	_O_BINARY
+#else
+#define O_BINARY	0
+#endif
 
 /* Report an unexpected error in GPGME and quit the application.  */
 void
@@ -176,7 +182,7 @@
     {
       gpg_error_t err;
 
-      target = creat (filename, 0666);
+      target = open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
       if (target == -1)
 	{
 	  gchar *message;
@@ -202,7 +208,7 @@
   gpg_error_t err;
   int target = -1;
 
-  target = open (filename, O_RDONLY);
+  target = open (filename, O_RDONLY | O_BINARY);
   if (target == -1)
     {
       gchar *message;



More information about the Gpa-commits mailing list