fix make-file-or-directory-link
This commit is contained in:
parent
69a208eb21
commit
4de2ff4cbd
|
@ -4723,7 +4723,7 @@ static Scheme_Object *make_link(int argc, Scheme_Object *argv[])
|
|||
if (!rktio_make_link(scheme_rktio, src, SCHEME_PATH_VAL(dest), dest_is_dir)) {
|
||||
if (scheme_last_error_is_racket(RKTIO_ERROR_EXISTS)) {
|
||||
scheme_raise_exn(MZEXN_FAIL_FILESYSTEM_EXISTS,
|
||||
"make-file-or-directory-link: cannot make directory;\n"
|
||||
"make-file-or-directory-link: cannot make link;\n"
|
||||
" the path already exists\n"
|
||||
" path: %q",
|
||||
filename_for_error(argv[0]));
|
||||
|
@ -4731,11 +4731,12 @@ static Scheme_Object *make_link(int argc, Scheme_Object *argv[])
|
|||
scheme_raise_exn(MZEXN_FAIL_FILESYSTEM,
|
||||
"make-file-or-directory-link: cannot make link\n"
|
||||
" path: %q\n"
|
||||
" system error: %R");
|
||||
" system error: %R",
|
||||
filename_for_error(argv[0]));
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return scheme_void;
|
||||
}
|
||||
|
||||
static Scheme_Object *file_modify_seconds(int argc, Scheme_Object **argv)
|
||||
|
|
|
@ -1038,7 +1038,10 @@ int rktio_make_link(rktio_t *rktio, const char *src, const char *dest, int dest_
|
|||
free(src_w);
|
||||
return 1;
|
||||
}
|
||||
get_windows_error();
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
set_racket_error(RKTIO_ERROR_EXISTS);
|
||||
else
|
||||
get_windows_error();
|
||||
free(src_w);
|
||||
} else
|
||||
set_racket_error(RKTIO_ERROR_UNSUPPORTED);
|
||||
|
@ -1051,7 +1054,10 @@ int rktio_make_link(rktio_t *rktio, const char *src, const char *dest, int dest_
|
|||
else if (errno != EINTR)
|
||||
break;
|
||||
}
|
||||
get_posix_error();
|
||||
if (errno == EEXIST)
|
||||
set_racket_error(RKTIO_ERROR_EXISTS);
|
||||
else
|
||||
get_posix_error();
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user