diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-07-27 16:19:42 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-07-27 16:19:42 +0000 |
commit | 969ead97091953e57eacaf9f57695283bd4cacff (patch) | |
tree | f2d5fb525d44b5341eac21421bf06939b831e0bc /usr.bin | |
parent | caa72dcb5ac60ac141b47ee8673b732931adb683 (diff) |
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.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/log.c | 31 | ||||
-rw-r--r-- | usr.bin/cvs/log.h | 5 |
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 */ |