summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/log.c31
-rw-r--r--usr.bin/cvs/log.h5
2 files changed, 30 insertions, 6 deletions
diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c
index 55d1be069a1..6b90c675549 100644
--- a/usr.bin/cvs/log.c
+++ b/usr.bin/cvs/log.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: log.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */
+/* $OpenBSD: log.c,v 1.2 2004/07/27 16:19:41 jfb Exp $ */
/*
- * Copyright (c) 2004 Jean-Francois Brousseau <jfb@fugusec.net>
+ * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,7 @@
extern char *__progname;
+#ifdef unused
static char *cvs_log_levels[] = {
"debug",
"info",
@@ -47,7 +48,7 @@ static char *cvs_log_levels[] = {
"alert",
"error"
};
-
+#endif
static int cvs_slpriomap[] = {
LOG_DEBUG,
@@ -205,7 +206,6 @@ int
cvs_vlog(u_int level, const char *fmt, va_list vap)
{
int ecp;
- pid_t pid;
char prefix[64], buf[1024], ebuf[32];
FILE *out;
@@ -252,3 +252,26 @@ cvs_vlog(u_int level, const char *fmt, va_list vap)
return (0);
}
+
+
+/*
+ * cvs_printf()
+ *
+ * Wrapper function around printf() that prepends a 'M' or 'E' command when
+ * the program is acting as server.
+ */
+
+int
+cvs_printf(const char *fmt, ...)
+{
+ int ret;
+ va_list vap;
+
+ va_start(vap, fmt);
+
+ ret = vprintf(fmt, vap);
+
+ va_end(vap);
+
+ return (ret);
+}
diff --git a/usr.bin/cvs/log.h b/usr.bin/cvs/log.h
index a33c6d7c921..f3c186ce593 100644
--- a/usr.bin/cvs/log.h
+++ b/usr.bin/cvs/log.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: log.h,v 1.1 2004/07/13 22:02:40 jfb Exp $ */
+/* $OpenBSD: log.h,v 1.2 2004/07/27 16:19:41 jfb Exp $ */
/*
- * Copyright (c) 2004 Jean-Francois Brousseau <jfb@fugusec.net>
+ * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,5 +67,6 @@ void cvs_log_cleanup (void);
int cvs_log_filter (u_int, u_int);
int cvs_log (u_int, const char *, ...);
int cvs_vlog (u_int, const char *, va_list);
+int cvs_printf (const char *, ...);
#endif /* LOG_H */