Browse code

Use O_BINARY for cygwin

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@276 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/02/11 17:17:50
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Feb 11 08:19:54 GMT 2004 (njh)
2
+----------------------------------
3
+  * libclamav: Use O_BINARY when saving attachments which is required for
4
+	Cygwin. Thanks to "Andrey Cherezov" <andrey@cherezov.koenig.su>
5
+
1 6
 Wed Feb 11 00:08:26 CET 2004 (tk)
2 7
 ---------------------------------
3 8
   V 0.66 (released with OLE2 and Dazuko support disabled)
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.40  2004/02/11 08:15:59  nigelhorne
21
+ * Use O_BINARY for cygwin
22
+ *
20 23
  * Revision 1.39  2004/02/06 13:46:08  kojm
21 24
  * Support for clamav-config.h
22 25
  *
... ...
@@ -108,7 +111,7 @@
108 108
  * Compilable under SCO; removed duplicate code with message.c
109 109
  *
110 110
  */
111
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.39 2004/02/06 13:46:08 kojm Exp $";
111
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.40 2004/02/11 08:15:59 nigelhorne Exp $";
112 112
 
113 113
 #if HAVE_CONFIG_H
114 114
 #include "clamav-config.h"
... ...
@@ -324,7 +327,7 @@ cl_mbox(const char *dir, int desc)
324 324
 				lastLineWasEmpty = TRUE;
325 325
 				cli_dbgmsg("Finished processing message\n");
326 326
 			} else
327
-				lastLineWasEmpty = (buffer[0] == '\0');
327
+				lastLineWasEmpty = (bool)(buffer[0] == '\0');
328 328
 			messageAddLine(m, buffer);
329 329
 		} while(fgets(buffer, sizeof(buffer), fd) != NULL);
330 330
 	} else
... ...
@@ -1647,7 +1650,7 @@ saveFile(const blob *b, const char *dir)
1647 1647
 	fd = mkstemp(filename);
1648 1648
 #else
1649 1649
 	(void)mktemp(filename);
1650
-	fd = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
1650
+	fd = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_BINARY, 0600);
1651 1651
 #endif
1652 1652
 
1653 1653
 	if(fd < 0) {