libstdc++.exp (check_v3_target_fileio): Test lseek.
authorRichard Sandiford <rsandifo@nildram.co.uk>
Tue, 25 Sep 2007 21:18:11 +0000 (21:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 25 Sep 2007 21:18:11 +0000 (21:18 +0000)
libstdc++-v3/
* testsuite/lib/libstdc++.exp (check_v3_target_fileio): Test lseek.

From-SVN: r128772

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/lib/libstdc++.exp

index 9a27bde7adb6c71e7378fd8f9de63a25fe01706a..f274975795f5d5959ee6827c0d549448b864fb8a 100644 (file)
@@ -1,3 +1,7 @@
+2007-09-25  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * testsuite/lib/libstdc++.exp (check_v3_target_fileio): Test lseek.
+
 2007-09-17  Benjamin Kosnik  <bkoz@redhat.com>
            Chalathip Thumkanon  <chalathip@gmail.com>
 
index 4ba9dc57ef3e6ccfbfed77b2e3dbd2b7e05696ed..6603d71a01dc61aec3a2af6f69972cdb61e7e122 100644 (file)
@@ -599,15 +599,20 @@ proc check_v3_target_fileio { } {
        puts $f "int main ()"
        puts $f "{"
        puts $f "  int fd  = open (\".\", O_RDONLY);"
+       puts $f "  int ret = 0;"
        puts $f "  if (fd == -1)"
        puts $f "  {"
        puts $f "    int err = errno;"
        puts $f "    if (err == EIO || err == ENOSYS)"
-       puts $f "      return 1;"
+       puts $f "      ret = 1;"
        puts $f "  }"
        puts $f "  else"
+       puts $f "  {"
+       puts $f "    if (lseek (fd, 0, SEEK_CUR) == -1)"
+       puts $f "      ret = 1;"
        puts $f "    close (fd);"
-       puts $f "  return 0;"
+       puts $f "  }"
+       puts $f "  return ret;"
        puts $f "}" 
        close $f