summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-06-25 06:23:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-06-25 06:23:11 +0000
commit56edf9294d375808faecec4810d0f66a9d74b903 (patch)
treed5f5b752079a8841d98c1eb39cf5e2218be4747d /usr.bin
parentc0689a10074f5f5c2b57f1a4fb03834b6e2b33e1 (diff)
tmux doesn't and won't need syslog logging, so remove it and some other unused
functions found by lint. Also move a couple of internal function declarations into file scope.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/log.c34
-rw-r--r--usr.bin/tmux/tmux.h7
2 files changed, 6 insertions, 35 deletions
diff --git a/usr.bin/tmux/log.c b/usr.bin/tmux/log.c
index c0105e4d53c..79f6925ccee 100644
--- a/usr.bin/tmux/log.c
+++ b/usr.bin/tmux/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: log.c,v 1.2 2009/06/25 06:23:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -29,9 +29,8 @@
/* Logging type. */
#define LOG_TYPE_OFF 0
-#define LOG_TYPE_SYSLOG 1
-#define LOG_TYPE_TTY 2
-#define LOG_TYPE_FILE 3
+#define LOG_TYPE_TTY 1
+#define LOG_TYPE_FILE 2
int log_type = LOG_TYPE_OFF;
/* Log file, if needed. */
@@ -40,17 +39,8 @@ FILE *log_file;
/* Debug level. */
int log_level;
-/* Open logging to syslog. */
-void
-log_open_syslog(int level)
-{
- log_type = LOG_TYPE_SYSLOG;
- log_level = level;
-
- openlog(__progname, LOG_PID|LOG_NDELAY, LOG_FACILITY);
-
- tzset();
-}
+void log_vwrite(int, const char *, va_list);
+__dead void log_vfatal(const char *, va_list);
/* Open logging to tty. */
void
@@ -93,26 +83,12 @@ log_close(void)
/* Write a log message. */
void
-log_write(int pri, const char *msg, ...)
-{
- va_list ap;
-
- va_start(ap, msg);
- log_vwrite(pri, msg, ap);
- va_end(ap);
-}
-
-/* Write a log message. */
-void
log_vwrite(int pri, const char *msg, va_list ap)
{
char *fmt;
FILE *f = log_file;
switch (log_type) {
- case LOG_TYPE_SYSLOG:
- vsyslog(pri, msg, ap);
- break;
case LOG_TYPE_TTY:
if (pri == LOG_INFO)
f = stdout;
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index f453486a198..a0c040385ac 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.12 2009/06/25 06:15:04 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.13 2009/06/25 06:23:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1537,20 +1537,15 @@ uint8_t buffer_read8(struct buffer *);
int buffer_poll(struct pollfd *, struct buffer *, struct buffer *);
/* log.c */
-#define LOG_FACILITY LOG_DAEMON
-void log_open_syslog(int);
void log_open_tty(int);
void log_open_file(int, const char *);
void log_close(void);
-void log_vwrite(int, const char *, va_list);
-void log_write(int, const char *, ...);
void printflike1 log_warn(const char *, ...);
void printflike1 log_warnx(const char *, ...);
void printflike1 log_info(const char *, ...);
void printflike1 log_debug(const char *, ...);
void printflike1 log_debug2(const char *, ...);
void printflike1 log_debug3(const char *, ...);
-__dead void log_vfatal(const char *, va_list);
__dead void log_fatal(const char *, ...);
__dead void log_fatalx(const char *, ...);