summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfb <jfb@openbsd.org>2004-07-27 16:19:41 +0000
committerjfb <jfb@openbsd.org>2004-07-27 16:19:41 +0000
commit4743a7c5dbd3faa88cdcc4eb173fad624bec25ce (patch)
tree8670292166fc91097211d6711b4b6e375507c297
parent* use a mix of mktime() and ctime_r() instead of asctime_r() to calculate (diff)
downloadwireguard-openbsd-4743a7c5dbd3faa88cdcc4eb173fad624bec25ce.tar.xz
wireguard-openbsd-4743a7c5dbd3faa88cdcc4eb173fad624bec25ce.zip
Comment out unused code and some minor cleanup. Add the prototype and
skeleton for cvs_printf(), which will be used to output strings that do not need all of the handling that cvs_log() performs. This will be used among other things to prepend the `M' and `E' family of responses to output made by the `server' command.
-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 1421e219222..6b90c675549 100644
--- a/usr.bin/cvs/log.c
+++ b/usr.bin/cvs/log.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: log.c,v 1.1.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 2b98e4e98d2..f3c186ce593 100644
--- a/usr.bin/cvs/log.h
+++ b/usr.bin/cvs/log.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: log.h,v 1.1.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 */