packages/net/znc/patches/004-Fix-chansaver-loading.patch
Jonas Gorski e49e86e036 znc: update to 1.6.0
Fixes compilation with musl.

Requires GCC 4.7 or newer, so broken for octeon.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
2015-06-19 13:10:19 +02:00

38 lines
934 B
Diff

From 7e75018ba60a9f50ea9e936eb1b6eb6b44dbc668 Mon Sep 17 00:00:00 2001
From: J-P Nurmi <jpnurmi@gmail.com>
Date: Sat, 28 Feb 2015 21:15:23 +0100
Subject: [PATCH] Fix chansaver loading
CModules::LoadModule() sets the module type _after_ construction.
The constructor cannot therefore do actions based on the module
type. Move loading to OnLoad().
---
modules/chansaver.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/modules/chansaver.cpp
+++ b/modules/chansaver.cpp
@@ -21,6 +21,12 @@
class CChanSaverMod : public CModule {
public:
MODCONSTRUCTOR(CChanSaverMod) {
+ }
+
+ virtual ~CChanSaverMod() {
+ }
+
+ bool OnLoad(const CString& sArgsi, CString& sMessage) override {
switch (GetType()) {
case CModInfo::GlobalModule:
LoadUsers();
@@ -32,9 +38,7 @@ public:
LoadNetwork(GetNetwork());
break;
}
- }
-
- virtual ~CChanSaverMod() {
+ return true;
}
void LoadUsers() {