summaryrefslogtreecommitdiff
blob: 32893044a4fc4a418d241095934be194e9964729 (plain)
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
open with O_CREAT in second argument needs 3 arguments.
2009-03-05 Martin von Gagern
Reference: https://bugs.gentoo.org/261283

Index: grass-6.3.0/raster/r.drain/main.c
===================================================================
--- grass-6.3.0.orig/raster/r.drain/main.c
+++ grass-6.3.0/raster/r.drain/main.c
@@ -296,8 +296,8 @@ int main(int argc, char **argv)
     tempfile1 = G_tempfile();
     tempfile2 = G_tempfile();
 
-    fe = open(tempfile1, O_RDWR | O_CREAT);
-    fd = open(tempfile2, O_RDWR | O_CREAT);
+    fe = open(tempfile1, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+    fd = open(tempfile2, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
 
     /* transfer the input map to a temp file */
     for (i = 0; i < nrows; i++) {
Index: grass-6.3.0/raster/r.fill.dir/main.c
===================================================================
--- grass-6.3.0.orig/raster/r.fill.dir/main.c
+++ grass-6.3.0/raster/r.fill.dir/main.c
@@ -196,9 +196,9 @@ main(int argc, char **argv)
    tempfile2 = G_tempfile();
    tempfile3 = G_tempfile();
 
-   fe=open(tempfile1,O_RDWR|O_CREAT); /* elev */
-   fd=open(tempfile2,O_RDWR|O_CREAT); /* dirn */
-   fm=open(tempfile3,O_RDWR|O_CREAT); /* problems */
+   fe=open(tempfile1,O_RDWR|O_CREAT, S_IRUSR|S_IWUSR); /* elev */
+   fd=open(tempfile2,O_RDWR|O_CREAT, S_IRUSR|S_IWUSR); /* dirn */
+   fm=open(tempfile3,O_RDWR|O_CREAT, S_IRUSR|S_IWUSR); /* problems */
 
    G_message(_("Reading map..."));
    for(i=0;i<nrows;i++)