aboutsummaryrefslogtreecommitdiff
path: root/libexec/comsat
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-09-07 02:05:53 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-09-07 02:05:53 +0000
commit2a2959221408cba830b39bb7f49cb8b74e4deb1f (patch)
treeb32c6cb8bdf8cbbe59af3feb4a460b4e2e486619 /libexec/comsat
parent90ff799227d2fb2c9a79c6d539eb5afd9386c9b5 (diff)
downloadsrc-2a2959221408cba830b39bb7f49cb8b74e4deb1f.tar.gz
src-2a2959221408cba830b39bb7f49cb8b74e4deb1f.zip
Notes
Diffstat (limited to 'libexec/comsat')
-rw-r--r--libexec/comsat/comsat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
index 7fe1b606a4e5..acfde8faee1b 100644
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -54,7 +54,7 @@ static char sccsid[] = "@(#)comsat.c 8.1 (Berkeley) 6/4/93";
#include <netdb.h>
#include <paths.h>
#include <pwd.h>
-#include <sgtty.h>
+#include <termios.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -206,7 +206,7 @@ notify(utp, file, offset, folder)
{
FILE *tp;
struct stat stb;
- struct sgttyb gttybuf;
+ struct termios tio;
char tty[20], name[sizeof(utmp[0].ut_name) + 1];
(void)snprintf(tty, sizeof(tty), "%s%.*s",
@@ -229,9 +229,8 @@ notify(utp, file, offset, folder)
dsyslog(LOG_ERR, "%s: %s", tty, strerror(errno));
_exit(-1);
}
- (void)ioctl(fileno(tp), TIOCGETP, &gttybuf);
- cr = (gttybuf.sg_flags&CRMOD) && !(gttybuf.sg_flags&RAW) ?
- "\n" : "\n\r";
+ (void)tcgetattr(fileno(tp), &tio);
+ cr = (tio.c_oflag & (OPOST|ONLCR) == (OPOST|ONLCR)) ? "\n" : "\n\r";
(void)strncpy(name, utp->ut_name, sizeof(utp->ut_name));
name[sizeof(name) - 1] = '\0';
(void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s",