File: collect2-open.dpatch

package info (click to toggle)
gcc-3.3 1%3A3.3.6ds1-28
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 25,812 kB
  • ctags: 262
  • sloc: sh: 10,321; makefile: 1,050; perl: 155; awk: 23; cpp: 14
file content (43 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/sh -e

# DP: Provide required permissions for newly created file.
# DP: Call only used for temporary ldout file, thus using mode 0600.
# DP:
# DP: https://bugs.gentoo.org/256638
# DP:
# DP: 2009-01-30 Martin von Gagern

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p1 < $0
        cd ${dir}gcc && autoconf2.13
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
        rm -f ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- gcc-3.4.6/gcc/collect2.c
+++ gcc-3.4.6/gcc/collect2.c
@@ -1540,7 +1540,7 @@ collect_execute (const char *prog, char 
   if (redir)
     {
       /* Open response file.  */
-      redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
+      redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
 
       /* Duplicate the stdout and stderr file handles
 	 so they can be restored later.  */