File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,10 @@ pgsymlink(const char *oldpath, const char *newpath)
197
197
FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS , 0 );
198
198
199
199
if (dirhandle == INVALID_HANDLE_VALUE )
200
+ {
201
+ _dosmaperr (GetLastError ());
200
202
return -1 ;
203
+ }
201
204
202
205
/* make sure we have an unparsed native win32 path */
203
206
if (memcmp ("\\??\\" , oldpath , 4 ) != 0 )
@@ -230,8 +233,11 @@ pgsymlink(const char *oldpath, const char *newpath)
230
233
0 , 0 , & len , 0 ))
231
234
{
232
235
LPSTR msg ;
236
+ int save_errno ;
237
+
238
+ _dosmaperr (GetLastError ());
239
+ save_errno = errno ;
233
240
234
- errno = 0 ;
235
241
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
236
242
FORMAT_MESSAGE_IGNORE_INSERTS |
237
243
FORMAT_MESSAGE_FROM_SYSTEM ,
@@ -251,6 +257,9 @@ pgsymlink(const char *oldpath, const char *newpath)
251
257
252
258
CloseHandle (dirhandle );
253
259
RemoveDirectory (newpath );
260
+
261
+ errno = save_errno ;
262
+
254
263
return -1 ;
255
264
}
256
265
You can’t perform that action at this time.
0 commit comments