summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/tc.who.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-06-10 20:14:21 +0000
committerobrien <obrien@FreeBSD.org>2000-06-10 20:14:21 +0000
commit85b66f4b34daef6618e01f81ba3e799b9cbbf082 (patch)
tree0312ae26cda1507ae4657d30f0f21c9a53877db3 /contrib/tcsh/tc.who.c
parent1ac43653c055c440832211fd4562816d1f67fceb (diff)
downloadFreeBSD-src-85b66f4b34daef6618e01f81ba3e799b9cbbf082.zip
FreeBSD-src-85b66f4b34daef6618e01f81ba3e799b9cbbf082.tar.gz
Offical fixes to the history and I18N bugs ache found.
Diffstat (limited to 'contrib/tcsh/tc.who.c')
-rw-r--r--contrib/tcsh/tc.who.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/tcsh/tc.who.c b/contrib/tcsh/tc.who.c
index fe80702..91b2c03 100644
--- a/contrib/tcsh/tc.who.c
+++ b/contrib/tcsh/tc.who.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/tc.who.c,v 3.28 1998/04/08 13:59:13 christos Exp $ */
+/* $Header: /src/pub/tcsh/tc.who.c,v 3.29 2000/06/09 18:33:25 kim Exp $ */
/*
* tc.who.c: Watch logins and logouts...
*/
@@ -36,7 +36,7 @@
*/
#include "sh.h"
-RCSID("$Id: tc.who.c,v 3.28 1998/04/08 13:59:13 christos Exp $")
+RCSID("$Id: tc.who.c,v 3.29 2000/06/09 18:33:25 kim Exp $")
#include "tc.h"
@@ -236,8 +236,10 @@ watch_login(force)
* Don't open utmp all the time, stat it first...
*/
if (stat(_PATH_UTMP, &sta)) {
- xprintf(CGETS(26, 1, "cannot stat %s. Please \"unset watch\".\n"),
- _PATH_UTMP);
+ if (!force)
+ xprintf(CGETS(26, 1,
+ "cannot stat %s. Please \"unset watch\".\n"),
+ _PATH_UTMP);
# ifdef BSDSIGS
(void) sigsetmask(omask);
# else
@@ -255,8 +257,10 @@ watch_login(force)
}
stlast = sta.st_mtime;
if ((utmpfd = open(_PATH_UTMP, O_RDONLY)) < 0) {
- xprintf(CGETS(26, 2, "%s cannot be opened. Please \"unset watch\".\n"),
- _PATH_UTMP);
+ if (!force)
+ xprintf(CGETS(26, 2,
+ "%s cannot be opened. Please \"unset watch\".\n"),
+ _PATH_UTMP);
# ifdef BSDSIGS
(void) sigsetmask(omask);
# else
OpenPOWER on IntegriCloud