Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!rutgers!netsys!vector!chip From: chip@vector.Dallas.TX.US (Chip Rosenthal) Newsgroups: news.software.b Subject: Re: news pl 17 / bad newsgroups problem Message-ID: <103@vector.Dallas.TX.US> Date: 28 Apr 89 20:29:18 GMT References: <558@lehi3b15.csee.Lehigh.EDU> Reply-To: chip@vector.Dallas.TX.US (Chip Rosenthal) Organization: Dallas Semiconductor Lines: 125 In article <558@lehi3b15.csee.Lehigh.EDU> murrey@csee.Lehigh.EDU (Erik Murrey) writes: >if inews -U spawns rnews, which returns "256" when it cannot >find a valid newsgroup, it places the article in junk. Since rnews >returns with a non-zero exit-status, inews -U also places the bad news >batch in /usr/spool/news/.bad! Yeah. My hack for this follows. Index: inews.c *** inews.c.ORIG Fri Mar 24 00:17:14 1989 --- inews.c Fri Apr 28 14:39:06 1989 *************** *** 952,955 struct tm *tm, *gmtime(); int is_invalid = FALSE; int exitcode = 0; long now; --- 952,956 ----- struct tm *tm, *gmtime(); int is_invalid = FALSE; + int junked = FALSE; int exitcode = 0; long now; *************** *** 991,995 logerr("%s: No valid newsgroups found, moved to junk", header.nbuf); ! if (localize("junk")) savehist(histline); exitcode = 1; --- 992,996 ----- logerr("%s: No valid newsgroups found, moved to junk", header.nbuf); ! if (localize("junk")) { savehist(histline); junked = TRUE; *************** *** 993,996 if (localize("junk")) savehist(histline); exitcode = 1; goto writeout; --- 994,999 ----- if (localize("junk")) { savehist(histline); + junked = TRUE; + } exitcode = 1; goto writeout; *************** *** 1000,1004 if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) { logerr("Orphaned Response, moved to junk"); ! if (localize("junk")) savehist(histline); exitcode = 1; --- 1003,1007 ----- if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) { logerr("Orphaned Response, moved to junk"); ! if (localize("junk")) { savehist(histline); junked = TRUE; *************** *** 1002,1005 if (localize("junk")) savehist(histline); exitcode = 1; goto writeout; --- 1005,1010 ----- if (localize("junk")) { savehist(histline); + junked = TRUE; + } exitcode = 1; goto writeout; *************** *** 1009,1013 if (time((time_t *)0) > (cgtdate(header.subdate) + HISTEXP) ){ logerr("Article too old, moved to junk"); ! if (localize("junk")) savehist(histline); exitcode = 1; --- 1014,1018 ----- if (time((time_t *)0) > (cgtdate(header.subdate) + HISTEXP) ){ logerr("Article too old, moved to junk"); ! if (localize("junk")) { savehist(histline); junked = TRUE; *************** *** 1011,1014 if (localize("junk")) savehist(histline); exitcode = 1; goto writeout; --- 1016,1021 ----- if (localize("junk")) { savehist(histline); + junked = TRUE; + } exitcode = 1; goto writeout; *************** *** 1224,1228 } xxit((mode == PROC && filename[0] == '\0') ? 0 : ! (exitcode < 0 ? 0 : exitcode)); } --- 1231,1235 ----- } xxit((mode == PROC && filename[0] == '\0') ? 0 : ! (exitcode < 0 || junked ? 0 : exitcode)); } -- Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337