summaryrefslogtreecommitdiff
path: root/lib/ZLocations.c
diff options
context:
space:
mode:
authorGravatar Robert S. French <rfrench@mit.edu>1987-07-29 10:59:37 +0000
committerGravatar Robert S. French <rfrench@mit.edu>1987-07-29 10:59:37 +0000
commitf646ff47f8a9a5307d96bf14f7bb57dc4aa0d22c (patch)
treee2163e97b58c1005ddca987f2e7a3cd3a2b05ca3 /lib/ZLocations.c
parent3d4a3919420a98e95ce19cdeae7472adcd3a4266 (diff)
Added tty field
Diffstat (limited to 'lib/ZLocations.c')
-rw-r--r--lib/ZLocations.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ZLocations.c b/lib/ZLocations.c
index 8e9eeae..452291f 100644
--- a/lib/ZLocations.c
+++ b/lib/ZLocations.c
@@ -67,7 +67,7 @@ Z_SendLocation(class,opcode,auth)
long ourtime;
ZNotice_t notice,retnotice;
ZPacket_t buffer;
- char *bptr[2],host[MAXHOSTNAMELEN];
+ char *bptr[3],host[MAXHOSTNAMELEN],mytty[100];
struct hostent *hent;
notice.z_kind = ACKED;
@@ -92,6 +92,13 @@ Z_SendLocation(class,opcode,auth)
ourtime = time((long *)0);
bptr[1] = ctime(&ourtime);
bptr[1][strlen(bptr[1])-1] = '\0';
+
+ strcpy(mytty,ttyname(0));
+ bptr[2] = rindex(mytty,'/');
+ if (bptr[2])
+ bptr[2]++;
+ else
+ bptr[2] = mytty;
if ((retval = ZSendList(&notice,bptr,2,auth)) != ZERR_NONE)
return (retval);