From f999f5818e5de6944e1fb726cf75f089d2378026 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 3 Jul 2019 12:15:38 +0200 Subject: [PATCH] lirc: add patches from Debian Buster Signed-off-by: Matthias Reichl --- ...on-t-use-broken-LOG_CONS-syslog-flag.patch | 24 +++++++++++ ...Fix-connect-option-parsing-error-343.patch | 22 ++++++++++ ...Notify-systemd-on-successful-startup.patch | 43 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch create mode 100644 packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch create mode 100644 packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch diff --git a/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch b/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch new file mode 100644 index 0000000000..5cf3e2a647 --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch @@ -0,0 +1,24 @@ +From: Alec Leamas +Date: Fri, 23 Nov 2018 23:04:35 -0500 +Subject: [PATCH] logging: Don't use broken LOG_CONS syslog flag. + +--- + lib/lirc_log.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/lirc_log.c b/lib/lirc_log.c +index bea357b..900beb3 100644 +--- a/lib/lirc_log.c ++++ b/lib/lirc_log.c +@@ -102,9 +102,9 @@ int lirc_log_open(const char* _progname, int _nodaemon, loglevel_t level) + + if (use_syslog) { + if (nodaemon) +- openlog(syslogident, LOG_CONS | LOG_PID | LOG_PERROR, LOG_LOCAL0); ++ openlog(syslogident, LOG_PID | LOG_PERROR, LOG_LOCAL0); + else +- openlog(syslogident, LOG_CONS | LOG_PID, LOG_LOCAL0); ++ openlog(syslogident, LOG_PID, LOG_LOCAL0); + } else { + lf = fopen(logfile, "a"); + if (lf == NULL) { diff --git a/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch b/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch new file mode 100644 index 0000000000..e498661f99 --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch @@ -0,0 +1,22 @@ +From: Alec Leamas +Date: Sun, 30 Dec 2018 21:26:15 +0100 +Subject: [PATCH] lircd: Fix --connect option parsing error (#343). + +Bug: https://sourceforge.net/p/lirc/tickets/343/ +--- + daemons/lircd.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp +index d5be708..ad8dde9 100644 +--- a/daemons/lircd.cpp ++++ b/daemons/lircd.cpp +@@ -790,7 +790,7 @@ int add_peer_connection(const char* server_arg) + struct servent* service; + char server[strlen(server_arg) + 1]; + +- strncpy(server, server_arg, sizeof(server) - 1); ++ strncpy(server, server_arg, sizeof(server)); + + if (peern < MAX_PEERS) { + peers[peern] = (struct peer_connection*) malloc(sizeof( diff --git a/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch b/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch new file mode 100644 index 0000000000..ffe479817d --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch @@ -0,0 +1,43 @@ +From: William Manley +Date: Thu, 9 Aug 2018 18:26:44 +0100 +Subject: [PATCH] systemd support: Notify systemd on successful startup + +This allows systemd to detect the case where we've failed to startup +due to a failure to parse our config files. + +Origin: upstream, https://sourceforge.net/p/lirc/git/ci/b78df9b2950cf4 +Applied-Upstream: 0.11.0 +--- + daemons/lircd.cpp | 5 +++++ + systemd/lircd.service | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp +index ad8dde9..f559b62 100644 +--- a/daemons/lircd.cpp ++++ b/daemons/lircd.cpp +@@ -2469,6 +2469,11 @@ int main(int argc, char** argv) + if (!nodaemon) + daemonize(); + ++#ifdef HAVE_SYSTEMD ++ /* Tell systemd that we started up correctly */ ++ sd_notify(0, "READY=1"); ++#endif ++ + loop(); + + /* never reached */ +diff --git a/systemd/lircd.service b/systemd/lircd.service +index 7f75805..6af049b 100644 +--- a/systemd/lircd.service ++++ b/systemd/lircd.service +@@ -6,7 +6,7 @@ Wants=lircd-setup.service + After=network.target lircd-setup.service + + [Service] +-Type=simple ++Type=notify + ExecStart=/usr/sbin/lircd --nodaemon + ; User=lirc + ; Group=lirc