From ec55604a1cb0e41cfe5d999983d7f512cf23ddd8 Mon Sep 17 00:00:00 2001 From: jb Date: Thu, 22 Dec 2011 20:44:32 +0000 Subject: PR 51646 Use POSIX mode flags in open() argument. 2011-12-22 Janne Blomqvist Tobias Burnus 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182638 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/acinclude.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgfortran/acinclude.m4') diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index b6cb40430af..645b248deb4 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -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; -- cgit v1.2.1