aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bushnell <mib@gnu.org>1994-10-05 01:52:40 +0000
committerMichael Bushnell <mib@gnu.org>1994-10-05 01:52:40 +0000
commitf4d21c5c16defef5a901e160c93991765b5fbc9d (patch)
tree5a430b6e990ccdb8b8a7a1068a99c3ca8bd6be26
parent0c85e387f59ea6b88f831eb2986697f94790a51a (diff)
downloadgcc-f4d21c5c16defef5a901e160c93991765b5fbc9d.zip
gcc-f4d21c5c16defef5a901e160c93991765b5fbc9d.tar.gz
gcc-f4d21c5c16defef5a901e160c93991765b5fbc9d.tar.bz2
Define O_RDONLY if not already defined and use it in read_specs's call
to open. From-SVN: r8217
-rw-r--r--gcc/gcc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index e1e870e..db9c49a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -100,6 +100,11 @@ compilation is specified by a string called a "spec". */
#define NULL 0
#endif
+/* Define O_RDONLY if the system hasn't defined it for us. */
+#ifndef O_RDONLY
+#define O_RDONLY 0
+#endif
+
#ifndef GENERIC_PTR
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
#define GENERIC_PTR void *
@@ -1045,7 +1050,7 @@ read_specs (filename)
fprintf (stderr, "Reading specs from %s\n", filename);
/* Open and stat the file. */
- desc = open (filename, 0, 0);
+ desc = open (filename, O_RDONLY, 0);
if (desc < 0)
pfatal_with_name (filename);
if (stat (filename, &statbuf) < 0)