ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/root-tail/root-tail.c
(Generate patch)

Comparing root-tail/root-tail.c (file contents):
Revision 1.36 by pcg, Wed Mar 31 01:46:10 2004 UTC vs.
Revision 1.37 by pcg, Wed Mar 31 01:47:50 2004 UTC

658 if (stat (e->fname, &stats) < 0) 658 if (stat (e->fname, &stats) < 0)
659 { /* file missing? */ 659 { /* file missing? */
660 sleep (1); 660 sleep (1);
661 if (e->fp) 661 if (e->fp)
662 fclose (e->fp); 662 fclose (e->fp);
663 openlog (e); 663 if (openlog (e) == NULL)
664 continue; 664 continue;
665 if (fstat (fileno (e->fp), &stats) < 0)
666 continue;
665 } 667 }
666 668
667 /* HACK-3: stats can be uninitialised here (if the file didn't
668 * exist when stat() was called, but was recreated during the
669 * sleep(1)) */
670 if (stats.st_ino != e->inode) 669 if (stats.st_ino != e->inode)
671 { /* file renamed? */ 670 { /* file renamed? */
672 if (e->fp) 671 if (e->fp)
673 fclose (e->fp); 672 fclose (e->fp);
674 if (openlog (e) == NULL) 673 if (openlog (e) == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines