diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-10-15 07:11:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-10-15 07:11:25 +0000 |
commit | 0614ca434a6ff0995ea52b1852cc4639252931cb (patch) | |
tree | a3c849aba40d213e6bcb6acd6f1e589cd48345b0 /compat | |
parent | 8085adb8a2129098d71a159abb8bd42074badb91 (diff) | |
download | rtmux-0614ca434a6ff0995ea52b1852cc4639252931cb.tar.gz rtmux-0614ca434a6ff0995ea52b1852cc4639252931cb.tar.bz2 rtmux-0614ca434a6ff0995ea52b1852cc4639252931cb.zip |
Fill in the tty name in SunOS's forkpty compat, and use it in osdep_getname.
From Todd Carson.
Tweaked by me to nuke (void) casts. Say no to lint appeasement! ;-)
Diffstat (limited to 'compat')
-rw-r--r-- | compat/forkpty-sunos.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compat/forkpty-sunos.c b/compat/forkpty-sunos.c index 8d7caac5..67d8a029 100644 --- a/compat/forkpty-sunos.c +++ b/compat/forkpty-sunos.c @@ -1,4 +1,4 @@ -/* $Id: forkpty-sunos.c,v 1.8 2009-09-20 18:31:16 nicm Exp $ */ +/* $Id: forkpty-sunos.c,v 1.9 2009-10-15 07:11:25 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -27,7 +27,7 @@ #include "tmux.h" pid_t -forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws) +forkpty(int *master, char *name, struct termios *tio, struct winsize *ws) { int slave; char *path; @@ -42,6 +42,8 @@ forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws) if ((path = ptsname(*master)) == NULL) goto out; + if (name != NULL) + strlcpy(name, path, TTY_NAME_MAX); if ((slave = open(path, O_RDWR|O_NOCTTY)) == -1) goto out; |