summaryrefslogtreecommitdiffstats
path: root/usr.sbin/faithd/tcp.c
diff options
context:
space:
mode:
authorsuz <suz@FreeBSD.org>2002-04-19 04:46:24 +0000
committersuz <suz@FreeBSD.org>2002-04-19 04:46:24 +0000
commit553226e8e16639b00d61d81e0125330dbfb7eed8 (patch)
tree100274bd96d0c95cafbe1a4a5961b54fc403fd47 /usr.sbin/faithd/tcp.c
parentae841d33c320c4185ecaa0e982c744039b1ba10f (diff)
downloadFreeBSD-src-553226e8e16639b00d61d81e0125330dbfb7eed8.zip
FreeBSD-src-553226e8e16639b00d61d81e0125330dbfb7eed8.tar.gz
just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.
(based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
Diffstat (limited to 'usr.sbin/faithd/tcp.c')
-rw-r--r--usr.sbin/faithd/tcp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/faithd/tcp.c b/usr.sbin/faithd/tcp.c
index c754dfc..68a2f51 100644
--- a/usr.sbin/faithd/tcp.c
+++ b/usr.sbin/faithd/tcp.c
@@ -1,4 +1,4 @@
-/* $KAME: tcp.c,v 1.5 2000/09/29 03:48:31 sakane Exp $ */
+/* $KAME: tcp.c,v 1.8 2001/11/21 07:40:22 itojun Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@@ -60,7 +60,7 @@ static fd_set readfds, writefds, exceptfds;
static char atmark_buf[2];
static pid_t cpid = (pid_t)0;
static pid_t ppid = (pid_t)0;
-static time_t child_lastactive = (time_t)0;
+volatile time_t child_lastactive = (time_t)0;
static time_t parent_lastactive = (time_t)0;
static void sig_ctimeout __P((int));
@@ -179,7 +179,7 @@ send_data(int s_rcv, int s_snd, const char *service, int direction)
return;
retry_or_err:
if (errno != EAGAIN)
- exit_failure("writing relay data failed: %s", ERRSTR);
+ exit_failure("writing relay data failed: %s", strerror(errno));
FD_SET(s_snd, &writefds);
}
@@ -210,7 +210,7 @@ relay(int s_rcv, int s_snd, const char *service, int direction)
if (error == -1) {
if (errno == EINTR)
continue;
- exit_failure("select: %s", ERRSTR);
+ exit_failure("select: %s", strerror(errno));
} else if (error == 0) {
readfds = oreadfds;
writefds = owritefds;
@@ -237,7 +237,7 @@ relay(int s_rcv, int s_snd, const char *service, int direction)
goto oob_read_retry;
exit_failure("reading oob data failed"
": %s",
- ERRSTR);
+ strerror(errno));
}
}
}
@@ -251,7 +251,7 @@ relay(int s_rcv, int s_snd, const char *service, int direction)
if (errno == EINTR)
goto relaydata_read_retry;
exit_failure("reading relay data failed: %s",
- ERRSTR);
+ strerror(errno));
/* NOTREACHED */
case 0:
/* to close opposite-direction relay process */
@@ -282,7 +282,8 @@ tcp_relay(int s_src, int s_dst, const char *service)
cpid = fork();
switch (cpid) {
case -1:
- exit_failure("tcp_relay: can't fork grand child: %s", ERRSTR);
+ exit_failure("tcp_relay: can't fork grand child: %s",
+ strerror(errno));
/* NOTREACHED */
case 0:
/* child process: relay going traffic */
OpenPOWER on IntegriCloud