Skip to content

Commit

Permalink
Merge pull request git-for-windows#1334 from max630/mingw-direct-Crea…
Browse files Browse the repository at this point in the history
…teHardLinkW

mingw: use CreateHardLink directly
  • Loading branch information
dscho authored and jamill committed Aug 28, 2018
2 parents 8ce0e69 + 10b6d6c commit 8544abe
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2703,13 +2703,8 @@ int mingw_raise(int sig)

int link(const char *oldpath, const char *newpath)
{
DECLARE_PROC_ADDR(kernel32.dll, BOOL, CreateHardLinkW,
LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
wchar_t woldpath[MAX_LONG_PATH], wnewpath[MAX_LONG_PATH];

if (!INIT_PROC_ADDR(CreateHardLinkW))
return -1;

if (xutftowcs_long_path(woldpath, oldpath) < 0 ||
xutftowcs_long_path(wnewpath, newpath) < 0)
return -1;
Expand Down

0 comments on commit 8544abe

Please sign in to comment.