fix copy-file' reporting of exn:fail:filesystem:exists?'

Fixes re-report for PR 12074
This commit is contained in:
Matthew Flatt 2011-11-19 19:40:49 -07:00
parent 4464f2bf19
commit d416dfaa8c
2 changed files with 3 additions and 0 deletions

View File

@ -129,6 +129,8 @@
(test #f copy-file/tf "tmp5" "down")
(test #f copy-file/tf "tmp5" (build-path deepdir "moredeep" "tmp5y"))
(test (file-size "tmp5") file-size "tmp5y")
(err/rt-test (copy-file "tmp5" "tmp5y") exn:fail:filesystem:exists?)
(err/rt-test (copy-file "no-such-tmp5" "tmp5y") (lambda (x) (not (exn:fail:filesystem:exists? x))))
(delete-file "tmp5y")
(test #t rename-file-or-directory/tf "tmp5" "tmp5x")

View File

@ -3908,6 +3908,7 @@ static Scheme_Object *copy_file(int argc, Scheme_Object **argv)
if (!out) {
scheme_close_input_port(in);
has_err_val = !!err_val;
pre_exists = (err_val == EEXIST);
goto failed;
}