From fa21f636f657893d3487198db5fd43c7f16ee341 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 19 Aug 2012 16:05:24 -0400 Subject: [PATCH] apcupsd: Fix build with GCC 4.4. --- lfs/apcupsd | 1 + src/patches/apcupsd-3.14.4-fix-gcc44.patch | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/patches/apcupsd-3.14.4-fix-gcc44.patch diff --git a/lfs/apcupsd b/lfs/apcupsd index 5638cabc3d..a0da9357eb 100644 --- a/lfs/apcupsd +++ b/lfs/apcupsd @@ -77,6 +77,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/apcupsd-3.14.4-fix-gcc44.patch cd $(DIR_APP) && ./configure --prefix=/usr --enable-usb --enable-cgi \ --with-cgi-bin=/srv/web/ipfire/cgi-bin cd $(DIR_APP) && make $(MAKETUNING) diff --git a/src/patches/apcupsd-3.14.4-fix-gcc44.patch b/src/patches/apcupsd-3.14.4-fix-gcc44.patch new file mode 100644 index 0000000000..00520980e8 --- /dev/null +++ b/src/patches/apcupsd-3.14.4-fix-gcc44.patch @@ -0,0 +1,17 @@ +diff -up apcupsd-3.14.5/src/apcaccess.c.gcc44 apcupsd-3.14.5/src/apcaccess.c +--- apcupsd-3.14.5/src/apcaccess.c.gcc44 2009-02-24 10:36:35.781325750 +0100 ++++ apcupsd-3.14.5/src/apcaccess.c 2009-02-24 10:38:12.416285478 +0100 +@@ -86,10 +86,10 @@ int main(int argc, char **argv) + } + + if (argc > 2) { /* assume host:port */ +- char *p; ++ char *p = argv[2]; + +- host = argv[2]; +- p = strchr(host, ':'); ++ host = p; ++ p = strchr(p, ':'); + if (p) { + *p++ = 0; + port = atoi(p); -- 2.39.2