Article View: news.software.nntp
Article #218Re: Bug in GROUP command ?
From: Didier Poirot
Date: Thu, 22 Jun 1989 09:21
Date: Thu, 22 Jun 1989 09:21
60 lines
2681 bytes
2681 bytes
In article <18381@paris.ics.uci.edu>, nagel@paris.ics.uci.edu (Mark
Nagel) writes:
>
> | I have made a little mod. in group.c to call read_groups() if the stat()
> |of the active file has changed since the last invokation of the command.
> |It slow down a little when I enter the GROUP command, but now I have
the right result. It is more faster than closing then starting the server.
>
> If your patch isn't huge, I'm sure many people would appreciate seeing
> it here (I would!). Since this is a pretty transparent type of
> change, I think it should at least be an option in conf.h in the next
> official patch...
>
So, hope you'll be heard! Here it is. As you can see, it is rather small.
It has been constructed on the version 1.12 of group.c.
*** group.c.old Thu Jun 22 11:01:55 1989
--- group.c Mon Jun 5 16:25:55 1989
***************
*** 24,29 ****
--- 24,32 ----
char *reqlist[2];
+ static long last_mtime;
+ struct stat statbuf; /* struct for stat() call */
+
if (argc != 2) {
printf("%d Usage: GROUP newsgroup.\r\n", ERR_CMDSYN);
(void) fflush(stdout);
***************
*** 42,47 ****
--- 45,59 ----
(void) fflush(stdout);
return;
}
+
+ if (stat(activefile, &statbuf) < 0)
+ return;
+
+ if (statbuf.st_mtime != last_mtime) { /* active file modified ?? */
+ last_mtime = statbuf.st_mtime;
+ num_groups = read_groups(); /* Read in the active file */
+ }
+
if (find_group(argv[1], num_groups, &low_msg, &high_msg) < 0) {
printf("%d Invalid group name (not in active).\r\n",
ERR_NOGROUP);
Didier.
/ / Didier Poirot
__/ o __/ o _ __ Chorus Systemes
(_(_(_(_(_(_(<_/ (_ 6 avenue Gustave Eiffel
F-78182, St-Quentin-en-Yvelines-Cedex
dp@chorus.fr (Internet)
Technical Details
Message-ID:
<2721@chorus.fr>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!lll-winken!uunet!mcvax!inria!chorus!adagio.chorus.fr!dpReferences:
<18381@paris.ics.uci.edu> <2692@chorus.fr>Show Full Headers
Complete Article Headers
Message-ID: <2721@chorus.fr> Subject: Re: Bug in GROUP command ? Date: Thu, 22 Jun 1989 09:21:26 +0000 From: dp@chorus.fr (Didier Poirot) References: <18381@paris.ics.uci.edu> <2692@chorus.fr> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!lll-winken!uunet!mcvax!inria!chorus!adagio.chorus.fr!dp Newsgroups: news.software.nntp Sender: news@chorus.fr Lines: 59