+2010-11-04 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * io/unix.h (struct unix_stream): Remove prot member.
+ * io/unix.c: Remove PROT_READ and PROT_WRITE constants.
+ (fd_to_stream): Remove prot from argument list, don't set prot.
+ (open_external): Don't set prot flag.
+ (input_stream): Remove prot from argument list.
+ (output_stream): Likewise.
+ (error_stream): Likewise.
+
2010-11-03 Janne Blomqvist <jb@gcc.gnu.org>
* io/unix.h: Remove empty_internal_buffer prototype.
#define PATH_MAX 1024
#endif
-#ifndef PROT_READ
-#define PROT_READ 1
-#endif
-
-#ifndef PROT_WRITE
-#define PROT_WRITE 2
-#endif
-
/* These flags aren't defined on all targets (mingw32), so provide them
here. */
#ifndef S_IRGRP
* around it. */
static stream *
-fd_to_stream (int fd, int prot)
+fd_to_stream (int fd)
{
gfstat_t statbuf;
unix_stream *s;
s->buffer_offset = 0;
s->physical_offset = 0;
s->logical_offset = 0;
- s->prot = prot;
/* Get the current length of the file. */
stream *
open_external (st_parameter_open *opp, unit_flags *flags)
{
- int fd, prot;
+ int fd;
if (flags->status == STATUS_SCRATCH)
{
return NULL;
fd = fix_fd (fd);
- switch (flags->action)
- {
- case ACTION_READ:
- prot = PROT_READ;
- break;
-
- case ACTION_WRITE:
- prot = PROT_WRITE;
- break;
-
- case ACTION_READWRITE:
- prot = PROT_READ | PROT_WRITE;
- break;
-
- default:
- internal_error (&opp->common, "open_external(): Bad action");
- }
-
- return fd_to_stream (fd, prot);
+ return fd_to_stream (fd);
}
stream *
input_stream (void)
{
- return fd_to_stream (STDIN_FILENO, PROT_READ);
+ return fd_to_stream (STDIN_FILENO);
}
setmode (STDOUT_FILENO, O_BINARY);
#endif
- s = fd_to_stream (STDOUT_FILENO, PROT_WRITE);
+ s = fd_to_stream (STDOUT_FILENO);
return s;
}
setmode (STDERR_FILENO, O_BINARY);
#endif
- s = fd_to_stream (STDERR_FILENO, PROT_WRITE);
+ s = fd_to_stream (STDERR_FILENO);
return s;
}