NNTPC: patch for a working -b (untested)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's one for you to test.  It's also included with the previous patch at

{ftp,http}://greathan.apana.org.au/pub/nntpcache/nntpcache-1.0.1.patch
-- 
Debian GNU/Linux 1.2 is out! { http://www.debian.org/ }
Email:  Herbert Xu ~{PmV>HI~} <herbert@greathan.apana.org.au>
{ http://greathan.apana.org.au/~herbert/ }
PGP Key:  pgp-public-keys@pgp.mit.edu or any other key sites
--
diff -ur --new-file nntpcache-1.0.1.orig/nntpcache.c nntpcache-1.0.1/nntpcache.c
--- nntpcache-1.0.1.orig/nntpcache.c	Sat Nov  9 07:47:38 1996
+++ nntpcache-1.0.1/nntpcache.c	Sat Feb  1 14:38:04 1997
@@ -553,6 +576,7 @@
 	int nodetach = FALSE;
 	char *config_file = con.configFile;
 	char *access_file = con.accessFile;
+	char *bindAddr = 0;
 	struct hostent *hp;
 	bool f_swap_child = FALSE;
 	struct authent *gauth = NULL; /* stop gcc complaining */
@@ -596,7 +620,7 @@
 			nodetach = TRUE;
 			break;
 		case 'b':
-			con.bindAddr = optarg;
+			bindAddr = optarg;
 			break;
 		case 'r':
 			printf ("zorching %s/{cache.mmap,%s.{dir,pag}}!\n", con.cacheDir, con.historyFile);
@@ -665,6 +693,11 @@
 	}
 	if (!load_config (config_file))
 		Exit (1);
+	if (bindAddr)
+	{
+		if (con.bindAddr) free(con.bindAddr);
+		con.bindAddr = Sstrdup(bindAddr);
+	}
 	overviewFmt=overviewFmtGen(con.overviewFmt, &overviewFmt_hash);
 	overviewFmtDef=overviewFmtGen(con.overviewFmtDef, &overviewFmtDef_hash);
 	if (chdir (con.configDir) == -1)


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux