Close and unlink test file before exit.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179774
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-10-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_effective_target_fd_truncate):
+ Close and unlink test file before exit.
+
2011-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/50564
int fd;
const char t[] = "test writing more than ten characters";
char s[11];
- fd = fileno (f);
+ int status = 0;
+ fd = fileno (f);
write (fd, t, sizeof (t) - 1);
lseek (fd, 0, 0);
if (ftruncate (fd, 10) != 0)
- exit (1);
+ status = 1;
close (fd);
+ fclose (f);
+ if (status)
+ {
+ unlink ("tst.tmp");
+ exit (status);
+ }
f = fopen ("tst.tmp", "rb");
if (fread (s, 1, sizeof (s), f) != 10 || strncmp (s, t, 10) != 0)
- exit (1);
- exit (0);
+ status = 1;
+ fclose (f);
+ unlink ("tst.tmp");
+ exit (status);
}
}