another Micorport bug with C news

Jeff Mann mann at intacc.uucp
Thu Jul 13 12:29:41 AEST 1989


I'm not sure how far this problem goes, but on this System V/AT rel 2.3,
fseek(3)  causes  some  weird action from relaynews.  It seems that when
working with a file which  has  been  opened  for  update  (read/write),
performing  an  fseek after any writes causes subsequent writes to fail.
I believe that this is a bug in the Microport software, but  whether  it
is in fseek, or somewhere else, I don't know.

In  relay/history.c,  in  the history() function, the fseek() causes the
subsequent fprintf of the history line to fail if the history  file  had
already  been  opened  and  written  to.   This  means you will get many
articles installed (relaynews doesn't complain when it happens)  without
history entries, and they can't be expired (use mkhist to find them).

My  workaround is to move this fseek from where it is to right after the
fopenwclex in openhist(), and to rely on the fact that the file  pointer
will  be left at EOF after any writes.  However, gethistory() also calls
fseek() when it needs to get  a  history  line.   The  only  place  that
gethistory()  is called is from control.c when cancelling an article.  I
changed gethistory() to close the history  file  after  doing  so.   (Oh
yeah,  gethistory  is also used in the ihave/sendme stuff, but I haven't
looked at how this would affect it.)

I think this  will work, but I haven't really tested it.  I'd appreciate
any better ideas...


-- 
| Jeff Mann - Inter/Access, Toronto           ...uunet!mnetor!intacc!mann  |
| "A picture is worth 256 thousand words"  {utzoo, utgpu}!chp!intacc!mann  |



More information about the Comp.unix.microport mailing list