diff options
author | Christopher Faylor <me@cgf.cx> | 2001-04-22 20:19:27 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-04-22 20:19:27 +0400 |
commit | 96dc5dd7e594df1a835f3303e9fee5f5a8c78206 (patch) | |
tree | 479ef1db203d6fd56805aa4a7ee7374fe0460437 /winsup/cygwin/shortcut.c | |
parent | da77d416c54dda36b2284e9713bb2f5251d15a1c (diff) |
* shortcut.c (check_shortcut): Close input file handle before returning.
* path.cc (check_sysfile): Ditto.
(symlink_info::check): Rely on opened file handle being closed by symlink
checking routines. Set ext_tacked_on when .lnk is detected.
Diffstat (limited to 'winsup/cygwin/shortcut.c')
-rw-r--r-- | winsup/cygwin/shortcut.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/shortcut.c b/winsup/cygwin/shortcut.c index b7ca86905..b47cec52a 100644 --- a/winsup/cygwin/shortcut.c +++ b/winsup/cygwin/shortcut.c @@ -98,7 +98,7 @@ check_shortcut (const char *path, DWORD fileattr, HANDLE h, goto close_it; /* Read the files header information. This is used to check for a Cygwin or U/WIN shortcut or later to check for executable files. */ - if (! ReadFile (h, file_header, SHORTCUT_HDR_SIZE, &got, 0)) + if (!ReadFile (h, file_header, SHORTCUT_HDR_SIZE, &got, 0)) { *error = EIO; goto close_it; @@ -160,8 +160,7 @@ close_it: psl->lpVtbl->Release(psl); /* Uninitialize COM library. */ CoUninitialize (); + CloseHandle (h); return res; } - - |