diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-14 20:52:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-14 20:52:40 +0000 |
commit | 4f822908436b0a8cd55030f42d5557ff2512607f (patch) | |
tree | 1816a4d5509a71bb1427fee88a615844c35ca65e /bin/mt | |
parent | 4a42c58cde8d4a3d7b1425fd7812b76e445ba54d (diff) |
in a signal handler, change errx() to warnx() + _exit; millert ok
Diffstat (limited to 'bin/mt')
-rw-r--r-- | bin/mt/mtrmt.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/mt/mtrmt.c b/bin/mt/mtrmt.c index 14fb14665a1..072877fc4eb 100644 --- a/bin/mt/mtrmt.c +++ b/bin/mt/mtrmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtrmt.c,v 1.7 1997/09/12 04:01:37 millert Exp $ */ +/* $OpenBSD: mtrmt.c,v 1.8 2001/11/14 20:52:39 deraadt Exp $ */ /* $NetBSD: mtrmt.c,v 1.2 1996/03/06 06:22:07 scottr Exp $ */ /*- @@ -83,7 +83,8 @@ static char *rmtpeer; static int okname __P((char *)); static int rmtcall __P((char *, char *)); -static void rmtconnaborted __P((/* int, int */)); +static void rmtconnaborted __P((void)); +static void sigrmtconnaborted __P((int)); static int rmtgetb __P((void)); static void rmtgetconn __P((void)); static void rmtgets __P((char *, int)); @@ -99,7 +100,7 @@ rmthost(host) strcpy(rmtpeer, host); else rmtpeer = host; - signal(SIGPIPE, rmtconnaborted); + signal(SIGPIPE, sigrmtconnaborted); rmtgetconn(); if (rmtape < 0) return (0); @@ -107,7 +108,15 @@ rmthost(host) } static void -rmtconnaborted() +sigrmtconnaborted(int sig) +{ + + warnx("Lost connection to remote host."); + _exit(1); +} + +static void +rmtconnaborted(void) { errx(1, "Lost connection to remote host."); |