From 762520f3bc4d160d2af658f5dd59dfd09d76bc7f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 8 Mar 2003 03:36:39 +0000 Subject: * path.h (PATH_LNK): New enum val. (path_conv::is_lnk_symlink): New function. True if path represents .lnk style symlink. * path.cc (check_shortcut): Set PATH_LNK in pflags when appropriate. (symlink_info::check): Ditto. Remove PATH_LNK from pflags initially. * syscalls.cc (unlink): Always remove readonly attribute from a symlink regardless of type. (link): (from Corinna Vinschen) Allow links to symlinks. Reset attributes on a symlink after successful link creation. (chmod): Use is_lnk_symlink where appropriate. (rename): Ditto. * tty.cc (create_tty_master): Call GetComputerName instead of cygwin_gethostname. Set ut_id. * syscalls.cc (login): Call endutent. (setutent): Do not seek after a fresh open. --- winsup/cygwin/path.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index dea1d372f..40a20fb14 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2775,7 +2775,7 @@ check_shortcut (const char *path, DWORD fileattr, HANDLE h, contents[len] = '\0'; res = len; if (res) /* It's a symlink. */ - *pflags = PATH_SYMLINK; + *pflags = PATH_SYMLINK | PATH_LNK; goto close_it; file_not_symlink: @@ -2990,11 +2990,11 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt) suffix_scan suffix; contents[0] = '\0'; - is_symlink = TRUE; + is_symlink = true; ext_here = suffix.has (path, suffixes); extn = ext_here - path; - pflags &= ~PATH_SYMLINK; + pflags &= ~(PATH_SYMLINK | PATH_LNK); case_clash = false; @@ -3043,6 +3043,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt) (res = get_symlink_ea (suffix.path, contents, sizeof (contents))) > 0) { pflags = PATH_SYMLINK; + if (sym_check == 1) + pflags |= PATH_LNK; debug_printf ("Got symlink from EA: %s", contents); break; } -- cgit v1.2.3