head 1.2; access; symbols OPENPKG_E1_MP_HEAD:1.2 OPENPKG_E1_MP:1.2 OPENPKG_E1_MP_2_STABLE:1.2 OPENPKG_E1_FP:1.2 OPENPKG_2_STABLE_MP:1.2 OPENPKG_2_STABLE_20061018:1.2 OPENPKG_2_STABLE_20060622:1.2 OPENPKG_2_STABLE:1.2.0.2 OPENPKG_2_STABLE_BP:1.2 OPENPKG_2_5_RELEASE:1.1 OPENPKG_2_5_SOLID:1.1.0.14 OPENPKG_2_5_SOLID_BP:1.1 OPENPKG_2_4_RELEASE:1.1 OPENPKG_2_4_SOLID:1.1.0.12 OPENPKG_2_4_SOLID_BP:1.1 OPENPKG_CW_FP:1.1 OPENPKG_2_3_RELEASE:1.1 OPENPKG_2_3_SOLID:1.1.0.10 OPENPKG_2_3_SOLID_BP:1.1 OPENPKG_2_2_RELEASE:1.1 OPENPKG_2_2_SOLID:1.1.0.8 OPENPKG_2_2_SOLID_BP:1.1 OPENPKG_2_1_RELEASE:1.1 OPENPKG_2_1_SOLID:1.1.0.6 OPENPKG_2_1_SOLID_BP:1.1 OPENPKG_2_0_RELEASE:1.1 OPENPKG_2_0_SOLID:1.1.0.4 OPENPKG_2_0_SOLID_BP:1.1 OPENPKG_1_3_RELEASE:1.1.2.1 OPENPKG_1_3_SOLID:1.1.2.1.0.2 OPENPKG_1_3_SOLID_BP:1.1.2.1 OPENPKG_1_STABLE_MP:1.1 OPENPKG_1_STABLE:1.1.0.2; locks; strict; comment @# @; 1.2 date 2006.03.06.19.27.59; author rse; state Exp; branches; next 1.1; commitid xdKhWMGR3R8vK9or; 1.1 date 2003.07.28.13.45.04; author thl; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2003.07.28.14.21.15; author rse; state Exp; branches; next ; desc @@ 1.2 log @upgrading package: nntpcache 3.0.1 -> 3.0.2 @ text @Index: src/nntpcache.c --- src/nntpcache.c.orig 2004-04-11 13:43:56 +0200 +++ src/nntpcache.c 2006-03-06 20:21:29 +0100 @@@@ -1242,7 +1242,12 @@@@ Task = task_info_new (nc_master, "master"); watchInit(); drop_priv(ncUID, ncGID); - sprintf (PidFile, "%.127s.%.164s", con->pidFile, con->bindAddr); + + if (strchr(con->pidFile, (int)'/') != NULL) + sprintf (PidFile, "%.127s", con->pidFile); + else + sprintf (PidFile, "%.127s.%.164s", con->pidFile, con->bindAddr); + if (!(fh = fopen (PidFile, "w"))) logw (("couldn't open pid file '%s'", PidFile)); else @@@@ -1431,6 +1436,7 @@@@ char *config_file = con->configFile; char *access_file = con->accessFile; char *bindAddr = NULL; + char *pidFile = NULL; struct hostent *hp; enum task_state task; char *p = NULL; @@@@ -1451,7 +1457,7 @@@@ assert(task_desc[nc_last] == NULL); task = nc_master; - while ((c = getopt (argc, argv, "ef:hnb:rc:s")) != -1) + while ((c = getopt (argc, argv, "ef:hnb:p:rc:s")) != -1) switch (c) { case 'a': @@@@ -1491,6 +1497,9 @@@@ case 'b': bindAddr = Sstrdup(optarg); break; + case 'p': + pidFile = Sstrdup(optarg); + break; case 's': SwapWithChild = TRUE; break; @@@@ -1558,6 +1567,10 @@@@ if (con->bindAddr) free(con->bindAddr); con->bindAddr = Sstrdup(bindAddr); } + if (pidFile) { + if (con->pidFile) free(con->pidFile); + con->pidFile = Sstrdup(pidFile); + } if (chdir (con->configDir) == -1) { loge (("couldn't set cwd to %s", con->configDir)); @ 1.1 log @%status; major rc and spec (un)install scriptlet improvments; patch to handle pid files; fsl LOG_NEWS issue; log rotation; daemon bind @ text @d1 4 a4 3 --- src/nntpcache.c.orig 2002-04-05 20:29:58.000000000 +0200 +++ src/nntpcache.c 2003-07-28 14:02:21.000000000 +0200 @@@@ -1247,7 +1247,12 @@@@ d18 1 a18 1 @@@@ -1436,6 +1441,7 @@@@ d26 1 a26 1 @@@@ -1456,7 +1462,7 @@@@ d35 1 a35 1 @@@@ -1496,6 +1502,9 @@@@ d45 1 a45 1 @@@@ -1563,6 +1572,10 @@@@ @ 1.1.2.1 log @MFC: merge latest changes @ text @@