mirror of git://gcc.gnu.org/git/gcc.git
PR 51646 Use POSIX mode flags in open() argument.
2011-12-22 Janne Blomqvist <jb@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR libfortran/51646 * acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Use POSIX mode flags, omit mode argument when flags argument does not have O_CREAT. * io/unix.c (tempfile): Use POSIX mode flags. * configure: Regenerate. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r182638
This commit is contained in:
parent
bbe847a162
commit
42dfafa935
|
|
@ -1,3 +1,13 @@
|
|||
2011-12-22 Janne Blomqvist <jb@gcc.gnu.org>
|
||||
Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR libfortran/51646
|
||||
* acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Use POSIX mode
|
||||
flags, omit mode argument when flags argument does not have
|
||||
O_CREAT.
|
||||
* io/unix.c (tempfile): Use POSIX mode flags.
|
||||
* configure: Regenerate.
|
||||
|
||||
2011-11-21 Andreas Tobler <andreast@fgznet.ch>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ int main ()
|
|||
{
|
||||
int fd;
|
||||
|
||||
fd = open ("testfile", O_RDWR | O_CREAT, S_IWRITE | S_IREAD);
|
||||
fd = open ("testfile", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR);
|
||||
if (fd <= 0)
|
||||
return 0;
|
||||
if (unlink ("testfile") == -1)
|
||||
|
|
@ -127,7 +127,7 @@ int main ()
|
|||
write (fd, "This is a test\n", 15);
|
||||
close (fd);
|
||||
|
||||
if (open ("testfile", O_RDONLY, S_IWRITE | S_IREAD) == -1 && errno == ENOENT)
|
||||
if (open ("testfile", O_RDONLY) == -1 && errno == ENOENT)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -25598,7 +25598,7 @@ int main ()
|
|||
{
|
||||
int fd;
|
||||
|
||||
fd = open ("testfile", O_RDWR | O_CREAT, S_IWRITE | S_IREAD);
|
||||
fd = open ("testfile", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR);
|
||||
if (fd <= 0)
|
||||
return 0;
|
||||
if (unlink ("testfile") == -1)
|
||||
|
|
@ -25606,7 +25606,7 @@ int main ()
|
|||
write (fd, "This is a test\n", 15);
|
||||
close (fd);
|
||||
|
||||
if (open ("testfile", O_RDONLY, S_IWRITE | S_IREAD) == -1 && errno == ENOENT)
|
||||
if (open ("testfile", O_RDONLY) == -1 && errno == ENOENT)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -1112,9 +1112,9 @@ tempfile (st_parameter_open *opp)
|
|||
|
||||
#if defined(HAVE_CRLF) && defined(O_BINARY)
|
||||
fd = open (template, O_RDWR | O_CREAT | O_EXCL | O_BINARY,
|
||||
S_IREAD | S_IWRITE);
|
||||
S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IREAD | S_IWRITE);
|
||||
fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
}
|
||||
while (fd == -1 && errno == EEXIST);
|
||||
|
|
|
|||
Loading…
Reference in New Issue