diff options
author | Britney Fransen <brfransen@gmail.com> | 2015-02-03 17:29:27 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2015-02-03 17:29:27 (GMT) |
commit | 1e1cbcd944e969a2034ae6cc4133c4911c8e87e0 (patch) | |
tree | b9d6f7cd0b075c2cdd73b6e7797fd4906fccba9a /abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch | |
parent | 570112c125d6e5f468bf3e1f9df7a4f2753a8ba1 (diff) | |
download | linhes_pkgbuild-1e1cbcd944e969a2034ae6cc4133c4911c8e87e0.zip linhes_pkgbuild-1e1cbcd944e969a2034ae6cc4133c4911c8e87e0.tar.gz linhes_pkgbuild-1e1cbcd944e969a2034ae6cc4133c4911c8e87e0.tar.bz2 |
lirc: update to 0.9.2
Diffstat (limited to 'abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch')
-rw-r--r-- | abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch b/abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch new file mode 100644 index 0000000..c186054 --- /dev/null +++ b/abs/core/lirc/0009-lib-lirc_log-Add-priority-labels-info-error.-to-sysl.patch @@ -0,0 +1,70 @@ +From dfe0f3c3170a029a47edd9adf2a1b9a975d496ae Mon Sep 17 00:00:00 2001 +From: Alec Leamas <leamas.alec@gmail.com> +Date: Sat, 10 Jan 2015 01:30:32 +0100 +Subject: [PATCH 09/13] lib/lirc_log: Add priority labels (info, error...) to + syslog msg (#89). + +--- + lib/lirc_log.c | 23 +++++++---------------- + 1 file changed, 7 insertions(+), 16 deletions(-) + +diff --git a/lib/lirc_log.c b/lib/lirc_log.c +index 307fb77..cf37e6d 100644 +--- a/lib/lirc_log.c ++++ b/lib/lirc_log.c +@@ -2,22 +2,8 @@ + ** lircd.c ***************************************************************** + **************************************************************************** + * +- * lircd - LIRC Decoder Daemon ++ * lirc_log - simple logging module. + * +- * Copyright (C) 1996,97 Ralph Metzler <rjkm@thp.uni-koeln.de> +- * Copyright (C) 1998,99 Christoph Bartelmus <lirc@bartelmus.de> +- * +- * ======= +- * HISTORY +- * ======= +- * +- * 0.1: 03/27/96 decode SONY infra-red signals +- * create mousesystems mouse signals on pipe /dev/lircm +- * 04/07/96 send ir-codes to clients via socket (see irpty) +- * 05/16/96 now using ir_remotes for decoding +- * much easier now to describe new remotes +- * +- * 0.5: 09/02/98 finished (nearly) complete rewrite (Christoph) + * + */ + +@@ -59,6 +45,8 @@ const char *logfile = "syslog"; + char progname[128] = {'?','\0'}; + static int nodaemon = 0; + ++static const int PRIO_LEN = 16; /**< Longest priority label, some margin. */ ++ + + static const char* prio2text(int prio) + { +@@ -246,6 +234,7 @@ void logprintf(loglevel_t prio, const char *format_str, ...) + { + int save_errno = errno; + va_list ap; ++ char buff[PRIO_LEN + strlen(format_str)]; + + #ifdef SYSTEMD_LOGPERROR_FIX + if (nodaemon && prio <= loglevel) { +@@ -258,8 +247,10 @@ void logprintf(loglevel_t prio, const char *format_str, ...) + } + #endif + if (use_syslog) { ++ snprintf(buff, sizeof(buff), ++ "%s: %s", prio2text(prio), format_str); + va_start(ap, format_str); +- vsyslog(prio, format_str, ap); ++ vsyslog(prio, buff, ap); + va_end(ap); + } else if (lf && prio <= loglevel) { + time_t current; +-- +2.2.2 + |