* 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.
This commit is contained in:
@@ -81,12 +81,18 @@ create_tty_master (int ttynum)
|
||||
{
|
||||
/* Log utmp entry */
|
||||
struct utmp our_utmp;
|
||||
DWORD len = sizeof our_utmp.ut_host;
|
||||
|
||||
bzero ((char *) &our_utmp, sizeof (utmp));
|
||||
(void) time (&our_utmp.ut_time);
|
||||
strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name));
|
||||
cygwin_gethostname (our_utmp.ut_host, sizeof (our_utmp.ut_host));
|
||||
GetComputerName (our_utmp.ut_host, &len);
|
||||
__small_sprintf (our_utmp.ut_line, "tty%d", ttynum);
|
||||
if ((len = strlen (our_utmp.ut_line)) >= UT_IDLEN)
|
||||
len -= UT_IDLEN;
|
||||
else
|
||||
len = 0;
|
||||
strncpy (our_utmp.ut_id, our_utmp.ut_line + len, UT_IDLEN);
|
||||
our_utmp.ut_type = USER_PROCESS;
|
||||
our_utmp.ut_pid = myself->pid;
|
||||
myself->ctty = ttynum;
|
||||
|
Reference in New Issue
Block a user