]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
go: fix checks for about I/O functions
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 2 Jan 2013 16:01:05 +0000 (17:01 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 2 Jan 2013 18:08:13 +0000 (19:08 +0100)
Reference:
<http://lists.gnu.org/archive/html/bug-autoconf/2013-01/msg00000.html>

* lib/autoconf/go.m4 (_AC_LANG_IO_PROGRAM(Go), AC_LANG_INT_SAVE): Here,
correctly use 'os.OpenFile()' <http://golang.org/pkg/os/#OpenFile>
rather than 'os.Open()' <http://golang.org/pkg/os/#Open> (which has
more restricted semantics and incompatible signature).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/autoconf/go.m4

index bf215bf649948b7e7ad65745b8e04d6967ce1f4d..bf1a4aea351fda0ebbd04d75845b4ee5a0a0e91e 100644 (file)
@@ -61,7 +61,7 @@ $2
 # Produce source that performs I/O.
 m4_define([_AC_LANG_IO_PROGRAM(Go)],
 [AC_LANG_PROGRAM([import ( "fmt"; "os" )],
-[f, err := os.Open("conftest.out", os.O_CREATE|os.O_WRONLY, 0777)
+[f, err := os.OpenFile("conftest.out", os.O_CREATE|os.O_WRONLY, 0777)
  if err != nil {
        fmt.Println(err)
        os.Exit(1)
@@ -107,7 +107,7 @@ import (
        "os"
 )
 ],
-[f, err := os.Open("conftest.val", os.O_CREATE|os.O_WRONLY, 0777)
+[f, err := os.OpenFile("conftest.val", os.O_CREATE|os.O_WRONLY, 0777)
  if err != nil {
        os.Exit(1)
  }