diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-16 14:24:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-16 14:24:12 (GMT) |
commit | 80a7fdbc9021b909938451f285dae0db0acd4161 (patch) | |
tree | bf4516da509e7d7522bdc2ce5f8de33dcdfab12d /win/tclWinFile.c | |
parent | 02ab7419f0b629a410b52be62f9694b7d1c42d3d (diff) | |
parent | 01279acc11a7ba28071cea16c9b2cddbe15cf34f (diff) | |
download | tcl-80a7fdbc9021b909938451f285dae0db0acd4161.zip tcl-80a7fdbc9021b909938451f285dae0db0acd4161.tar.gz tcl-80a7fdbc9021b909938451f285dae0db0acd4161.tar.bz2 |
Merge 8.6
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f51d6f5..38edd87 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -264,11 +264,21 @@ WinLink( TclWinConvertError(GetLastError()); } else if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { - /* - * Can't symlink files. - */ + if (!tclWinProcs.createSymbolicLink) { + /* + * Can't symlink files. + */ + Tcl_SetErrno(ENOTDIR); + } else if (tclWinProcs.createSymbolicLink(linkSourcePath, linkTargetPath, + 0x2 /* SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE */)) { + /* + * Success! + */ - Tcl_SetErrno(ENOTDIR); + return 0; + } + + TclWinConvertError(GetLastError()); } else { Tcl_SetErrno(ENODEV); } |