Browse code

pass mode to open with O_CREAT. Avoids build failure with -D_FORTIFY_SOURCE=2 on gcc4.3 with glibc 2.7.

git-svn: trunk@3385

Török Edvin authored on 2007/12/10 06:43:10
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sun Dec  9 11:43:03 EET 2007 (edwin)
2
+------------------------------------
3
+  * shared/misc.c: pass mode to open with O_CREAT. 
4
+  Avoids build failure with -D_FORTIFY_SOURCE=2 on gcc4.3 with glibc 2.7.
5
+
1 6
 Fri Dec  7 08:56:02 GMT 2007 (trog)
2 7
 -----------------------------------
3 8
   * libclamav/scanners.c: fixup return value.
... ...
@@ -165,7 +165,7 @@ int filecopy(const char *src, const char *dest)
165 165
     if((s = open(src, O_RDONLY|O_BINARY)) == -1)
166 166
 	return -1;
167 167
 
168
-    if((d = open(dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY)) == -1) {
168
+    if((d = open(dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 0644)) == -1) {
169 169
 	close(s);
170 170
 	return -1;
171 171
     }