summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/fatal.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cvs/fatal.c')
-rw-r--r--usr.bin/cvs/fatal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/cvs/fatal.c b/usr.bin/cvs/fatal.c
index 0d112eecd29..94c288516e1 100644
--- a/usr.bin/cvs/fatal.c
+++ b/usr.bin/cvs/fatal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fatal.c,v 1.9 2007/02/22 06:42:09 otto Exp $ */
+/* $OpenBSD: fatal.c,v 1.10 2007/05/26 20:13:45 ray Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
@@ -36,8 +36,13 @@
void
fatal(const char *fmt,...)
{
+ static int been_here;
va_list args;
+ /* Fatal should not loop, (the functions below can fatal). */
+ if (been_here++)
+ goto end;
+
va_start(args, fmt);
cvs_vlog(LP_ABORT, fmt, args);
va_end(args);
@@ -47,5 +52,6 @@ fatal(const char *fmt,...)
if (cvs_server_active)
cvs_server_send_response("error");
+ end:
exit(1);
}