From: Michael Tremer Date: Sun, 19 Aug 2012 20:05:24 +0000 (-0400) Subject: apcupsd: Fix build with GCC 4.4. X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=fa21f636f657893d3487198db5fd43c7f16ee341 apcupsd: Fix build with GCC 4.4. --- diff --git a/lfs/apcupsd b/lfs/apcupsd index 5638cabc3..a0da9357e 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 000000000..00520980e --- /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);