Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!boulder!fesk!news From: news@fesk.UUCP (news) Newsgroups: news.software.b Subject: rnews -U locking via .rnews.lock is broken in 2.11.17 Keywords: inews.c file-locking Message-ID: <216@fesk.UUCP> Date: 29 Jan 89 23:43:05 GMT Organization: SERI, Golden, CO Lines: 26 When spooling news and executing rnews -U from cron once an hour I get multiple copies of rnews -U running at the same time. I have tracked this down to one line of severely broken code in inews.c for the case of locking via the lock file SPOOL/.rnews.lock The patch below (hopefully) corrects the problem. *** save/inews.c Wed Jan 25 14:28:10 1989 --- inews.c Sun Jan 29 16:04:51 1989 *************** *** 1540,1546 /* assume a dead lock if the active file is over 12 hours old */ if (ret < 0 && (errno != EEXIST || ! (stat(bfr, &stbuf) == 0 && (time((char *)0) - stbuf.st_mtime) < DAYS/2))) { if (errno != EEXIST) #endif /* V7 */ --- 1540,1546 ----- /* assume a dead lock if the active file is over 12 hours old */ if (ret < 0 && (errno != EEXIST || ! (stat(spbuf, &stbuf) != 0 || (time((char *)0) - stbuf.st_mtime) < DAYS/2))) { if (errno != EEXIST) #endif /* V7 */