diff options
-rw-r--r-- | hcid/hcid.h | 7 | ||||
-rw-r--r-- | hcid/logging.c | 18 |
2 files changed, 18 insertions, 7 deletions
diff --git a/hcid/hcid.h b/hcid/hcid.h index 8d84af92..93f55bee 100644 --- a/hcid/hcid.h +++ b/hcid/hcid.h @@ -24,7 +24,6 @@ */ #include <time.h> -#include <stdarg.h> #include <syslog.h> #include <sys/types.h> #include <sys/ioctl.h> @@ -174,9 +173,9 @@ int read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key); int read_pin_length(bdaddr_t *local, bdaddr_t *peer); int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin); -void info(const char *format, va_list ap); -void error(const char *format, va_list ap); -void debug(const char *format, va_list ap); +void info(const char *format, ...); +void error(const char *format, ...); +void debug(const char *format, ...); static inline int find_conn(int dd, int dev_id, long arg) { diff --git a/hcid/logging.c b/hcid/logging.c index 9d0ff214..3b31366a 100644 --- a/hcid/logging.c +++ b/hcid/logging.c @@ -32,17 +32,29 @@ #include "hcid.h" -void info(const char *format, va_list ap) +void info(const char *format, ...) { + va_list ap; + + va_start(ap, format); vsyslog(LOG_INFO, format, ap); + va_end(ap); } -void error(const char *format, va_list ap) +void error(const char *format, ...) { + va_list ap; + + va_start(ap, format); vsyslog(LOG_ERR, format, ap); + va_end(ap); } -void debug(const char *format, va_list ap) +void debug(const char *format, ...) { + va_list ap; + + va_start(ap, format); vsyslog(LOG_DEBUG, format, ap); + va_end(ap); } |