File: 01_fix_open_calls.patch

package info (click to toggle)
epstool 3.08%2Brepack-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,080 kB
  • ctags: 2,888
  • sloc: ansic: 20,944; makefile: 78
file content (21 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Description: open() with O_CREAT needs to get a third "mode" argument.
--- a/src/epstool.c
+++ b/src/epstool.c
@@ -2824,7 +2824,7 @@
 		code = -1;
 	}
 	if ((code==0) && stdout_name && (hChildStdoutWr == -1)) {
-	    handle = open(stdout_name, O_WRONLY | O_CREAT);
+	    handle = open(stdout_name, O_WRONLY | O_CREAT, 0666);
 	    hChildStdoutWr = dup2(handle, 1);
 	    if (handle != -1)
 		close(handle);
@@ -2832,7 +2832,7 @@
 		code = -1;
 	}
 	if ((code==0) && stderr_name && (hChildStderrWr == -1)) {
-	    handle = open(stderr_name, O_WRONLY | O_CREAT);
+	    handle = open(stderr_name, O_WRONLY | O_CREAT, 0666);
 	    hChildStderrWr = dup2(handle, 2);
 	    if (handle != -1)
 		close(handle);