summaryrefslogtreecommitdiff
path: root/usr.bin/write/write.c
diff options
context:
space:
mode:
authorperry <perry@NetBSD.org>1997-01-17 01:52:12 +0000
committerperry <perry@NetBSD.org>1997-01-17 01:52:12 +0000
commit9cb735d26ba4b4023f370d04c67f6444cb15b268 (patch)
tree4b47fb90347f9ba8bb4e68b9e26582cc64b3349c /usr.bin/write/write.c
parent57e986e85a66fc930b2bb331e55d70905c8c3320 (diff)
fix write to print a warning if the sender has "mesg n" set, instead
of dying with an error. From Mark Weaver closes pr-355, per thorpej
Diffstat (limited to 'usr.bin/write/write.c')
-rw-r--r--usr.bin/write/write.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index 66ed06917f4..7f8f49226e4 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -1,4 +1,4 @@
-/* $NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $ */
+/* $NetBSD: write.c,v 1.6 1997/01/17 01:52:12 perry Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)write.c 8.2 (Berkeley) 4/27/95";
#endif
-static char *rcsid = "$NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $";
+static char *rcsid = "$NetBSD: write.c,v 1.6 1997/01/17 01:52:12 perry Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -96,8 +96,11 @@ main(argc, argv)
mytty = cp + 1;
if (term_chk(mytty, &msgsok, &atime, 1))
exit(1);
- if (!msgsok)
- errx(1, "you have write permission turned off");
+ if (!msgsok) {
+ (void)fprintf(stderr,
+ "warning: you have write permission turned off; "
+ "no reply possible\n");
+ }
myuid = getuid();