summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cvs/log.c')
-rw-r--r--usr.bin/cvs/log.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c
index ca5a305d117..a2dec0a2af8 100644
--- a/usr.bin/cvs/log.c
+++ b/usr.bin/cvs/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.3 2004/08/05 13:32:08 jfb Exp $ */
+/* $OpenBSD: log.c,v 1.4 2004/08/05 13:39:01 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -48,7 +48,8 @@ static char *cvs_log_levels[] = {
"warning",
"error",
"alert",
- "error"
+ "error",
+ "abort",
};
#endif
@@ -60,6 +61,7 @@ static int cvs_slpriomap[] = {
LOG_ERR,
LOG_ALERT,
LOG_ERR,
+ LOG_ERR,
};
@@ -211,24 +213,28 @@ cvs_vlog(u_int level, const char *fmt, va_list vap)
char prefix[64], buf[1024], ebuf[32];
FILE *out;
- ecp = 0;
-
- if (level > LP_MAX) {
+ if (level > LP_MAX)
return (-1);
- }
+
/* apply any filters */
- if (cvs_log_filters[level] == 1)
+ if (cvs_log_filters[level] != 0)
return (0);
if (level == LP_ERRNO)
ecp = errno;
+ else
+ ecp = 0;
#ifdef CVS
/* The cvs program appends the command name to the program name */
if (cvs_command != NULL) {
- snprintf(prefix, sizeof(prefix), "%s %s", __progname,
- cvs_command);
+ if (level == LP_ABORT)
+ snprintf(prefix, sizeof(prefix), "%s [%s aborted]",
+ __progname, cvs_command);
+ else
+ snprintf(prefix, sizeof(prefix), "%s %s", __progname,
+ cvs_command);
}
else /* just use the standard strlcpy */
#endif