Browse code

freshclam: use O_BINARY under Cygwin

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

Tomasz Kojm authored on 2004/02/15 10:05:59
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Feb 15 02:03:47 CET 2004 (tk)
2
+---------------------------------
3
+  * freshclam: use O_BINARY when saving database under Cygwin
4
+
1 5
 Sat Feb 14 19:08:44 GMT 2004 (njh)
2 6
 ---------------------------------
3 7
   * libclamav:	Handle spaces in boundaries
... ...
@@ -469,7 +469,11 @@ int get_database(const char *dbfile, int socketfd, const char *file, const char
469 469
         }
470 470
     }
471 471
 
472
+#ifdef C_CYGWIN
473
+    if((fd = open(file, O_WRONLY|O_CREAT|O_EXCL|O_BINARY, 0644)) == -1) {
474
+#else
472 475
     if((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0644)) == -1) {
476
+#endif
473 477
 	mprintf("@Can't open new file %s to write\n", file);
474 478
 	perror("open");
475 479
 	return -1;