File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -2153,24 +2153,12 @@ int mingw_raise(int sig)
2153
2153
2154
2154
int link (const char * oldpath , const char * newpath )
2155
2155
{
2156
- typedef BOOL (WINAPI * T )(LPCWSTR , LPCWSTR , LPSECURITY_ATTRIBUTES );
2157
- static T create_hard_link = NULL ;
2158
2156
wchar_t woldpath [MAX_PATH ], wnewpath [MAX_PATH ];
2159
2157
if (xutftowcs_path (woldpath , oldpath ) < 0 ||
2160
2158
xutftowcs_path (wnewpath , newpath ) < 0 )
2161
2159
return -1 ;
2162
2160
2163
- if (!create_hard_link ) {
2164
- create_hard_link = (T ) GetProcAddress (
2165
- GetModuleHandle ("kernel32.dll" ), "CreateHardLinkW" );
2166
- if (!create_hard_link )
2167
- create_hard_link = (T )- 1 ;
2168
- }
2169
- if (create_hard_link == (T )- 1 ) {
2170
- errno = ENOSYS ;
2171
- return -1 ;
2172
- }
2173
- if (!create_hard_link (wnewpath , woldpath , NULL )) {
2161
+ if (!CreateHardLinkW (wnewpath , woldpath , NULL )) {
2174
2162
errno = err_win_to_posix (GetLastError ());
2175
2163
return -1 ;
2176
2164
}
You can’t perform that action at this time.
0 commit comments