1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Jef Poskanzer and Craig Leres of the Lawrence Berkeley Laboratory. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 33 unchanged lines hidden (view full) --- 42 43#if 0 44#ifndef lint 45static char sccsid[] = "@(#)write.c 8.1 (Berkeley) 6/6/93"; 46#endif 47#endif 48 49#include <sys/cdefs.h> |
50__FBSDID("$FreeBSD: head/usr.bin/write/write.c 139718 2005-01-05 11:52:40Z cognet $"); |
51 52#include <sys/param.h> 53#include <sys/signal.h> 54#include <sys/stat.h> 55#include <sys/file.h> 56#include <sys/time.h> 57#include <ctype.h> 58#include <err.h> --- 192 unchanged lines hidden (view full) --- 251do_write(char *tty, char *mytty, uid_t myuid) 252{ 253 const char *login; 254 char *nows; 255 struct passwd *pwd; 256 time_t now; 257 char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512]; 258 |
259 /* Determine our login name before we reopen() stdout */ |
260 if ((login = getlogin()) == NULL) { 261 if ((pwd = getpwuid(myuid))) 262 login = pwd->pw_name; 263 else 264 login = "???"; 265 } 266 267 (void)snprintf(path, sizeof(path), "%s%s", _PATH_DEV, tty); --- 62 unchanged lines hidden --- |