From ad1c79d7ba89dd5967be3c1cfa780eb1daf9ce81 Mon Sep 17 00:00:00 2001 From: dota? =op Date: Tue, 6 Jan 2015 15:02:58 -0200 Subject: [PATCH] noip2: fix foreground patch Those lazy programmers... --- .../{foreground.patch => 01-foreground.patch} | 0 srcpkgs/noip2/patches/02-fix_foreground.patch | 88 +++++++++++++++++++ .../patches/{prefix.patch => 03-prefix.patch} | 0 srcpkgs/noip2/template | 2 +- 4 files changed, 89 insertions(+), 1 deletion(-) rename srcpkgs/noip2/patches/{foreground.patch => 01-foreground.patch} (100%) create mode 100644 srcpkgs/noip2/patches/02-fix_foreground.patch rename srcpkgs/noip2/patches/{prefix.patch => 03-prefix.patch} (100%) diff --git a/srcpkgs/noip2/patches/foreground.patch b/srcpkgs/noip2/patches/01-foreground.patch similarity index 100% rename from srcpkgs/noip2/patches/foreground.patch rename to srcpkgs/noip2/patches/01-foreground.patch diff --git a/srcpkgs/noip2/patches/02-fix_foreground.patch b/srcpkgs/noip2/patches/02-fix_foreground.patch new file mode 100644 index 0000000000..b89e1652dd --- /dev/null +++ b/srcpkgs/noip2/patches/02-fix_foreground.patch @@ -0,0 +1,88 @@ +--- noip2.c.old 2015-01-06 14:47:18.998335680 -0200 ++++ noip2.c 2015-01-06 14:47:36.957335245 -0200 +@@ -134,6 +134,10 @@ + + added -f flag to run in foreground + + patch suggested by rogi@skylittlesystem.org + ++ + January 2015 (dota? =op) version 2.1.9-1 ++ + hack to make foreground mode work as expected ++ + patch suggested by rogi@skylittlesystem.org ++ + */ + ///////////////////////////////////////////////////////////////////////////// + +@@ -352,6 +356,7 @@ + int debug = 0; + int timed_out = 0; + int background = 1; // new default ++int foreground_hack = 0; // FIXME: hack s2 + int port_to_use = CLIENT_IP_PORT; + int socket_fd = -1; + int config_fd = -1; +@@ -744,7 +749,8 @@ + shm_dump_active++; + break; + case 'f': +- background=0; ++ background=1; ++ foreground_hack=1; + break; + default: + Usage(); +@@ -1031,7 +1037,8 @@ + char *err_string; + static int startup = 1; + +- x = fork(); ++ /* FIXME: hack s2 */ ++ x = foreground_hack ? 0 : fork(); + switch (x) { + case -1: // error + err_string = strerror(errno); +@@ -1043,13 +1050,23 @@ + setsid(); + if (get_shm_info() == FATALERR) + return FATALERR; +- log2syslog++; +- if (log2syslog > 0) +- fclose(stderr); +- fclose(stdout); +- fclose(stdin); +- syslog(LOG_INFO, "v%s daemon started%s\n", +- VERSION, (nat) ? " with NAT enabled" : ""); ++ ++ /* FIXME: hack s2 */ ++ if (foreground_hack) { ++ printf("v%s daemon started%s\n", ++ VERSION, (nat) ? " with NAT enabled" : ""); ++ } ++ ++ else { ++ log2syslog++; ++ if (log2syslog > 0) ++ fclose(stderr); ++ fclose(stdout); ++ fclose(stdin); ++ syslog(LOG_INFO, "v%s daemon started%s\n", ++ VERSION, (nat) ? " with NAT enabled" : ""); ++ } ++ + while (background) { + delay = MAX(60, my_instance->interval * 60); + if (nat) +@@ -1089,7 +1106,14 @@ + if (background) // signal may have reset this! + Sleep(delay); + } +- syslog(LOG_INFO, "v%s daemon ended.\n", VERSION); ++ ++ /* FIXME: hack s2 */ ++ if (foreground_hack) ++ printf("v%s daemon ended.\n", VERSION); ++ ++ else ++ syslog(LOG_INFO, "v%s daemon ended.\n", VERSION); ++ + break; + } + return SUCCESS; diff --git a/srcpkgs/noip2/patches/prefix.patch b/srcpkgs/noip2/patches/03-prefix.patch similarity index 100% rename from srcpkgs/noip2/patches/prefix.patch rename to srcpkgs/noip2/patches/03-prefix.patch diff --git a/srcpkgs/noip2/template b/srcpkgs/noip2/template index 62b3c47808..7032e01445 100644 --- a/srcpkgs/noip2/template +++ b/srcpkgs/noip2/template @@ -1,7 +1,7 @@ # Template file for 'noip2' pkgname=noip2 version=2.1.9_1 -revision=2 +revision=3 homepage="http://www.noip.com" distfiles="https://www.noip.com/client/linux/noip-duc-linux.tar.gz" wrksrc="noip-2.1.9-1"