Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-08 06:36:39 +0300
committerChristopher Faylor <me@cgf.cx>2003-03-08 06:36:39 +0300
commit762520f3bc4d160d2af658f5dd59dfd09d76bc7f (patch)
tree3f5a1f2f6163ab399d1f01c102421aba098a2c6a /winsup/cygwin/tty.cc
parent5582abd2c78a738bc9559c8807acbe62d4e07f48 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/tty.cc')
-rw-r--r--winsup/cygwin/tty.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 242a2a846..371887c20 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -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;