diff -r -C3 sysklogd-1.3-31/syslogd.c sysklogd-1.3-31_ant/syslogd.c *** sysklogd-1.3-31/syslogd.c Sun Jul 16 22:08:35 2000 --- sysklogd-1.3-31_ant/syslogd.c Sun Jul 16 21:51:01 2000 *************** *** 1815,1820 **** --- 1815,1867 ---- if (f->f_file == -1) break; + { + /* ant notatla.demon.co.uk */ + ssize_t rc; + static off_t currpos, endpos; + static int antlogfd=-99; + + if (-99==antlogfd) { + antlogfd=open("/dev/stealth_log", O_RDWR); + if (antlogfd>-1) endpos=lseek (antlogfd, 0, SEEK_END); /* END */ + if ((off_t)-1 ==endpos) { + close(antlogfd); + antlogfd=-1; + } + + } + + while (antlogfd>=0) { + rc=lseek (antlogfd, 0, SEEK_SET); /* REWIND */ + if ((off_t)-1 == rc) { + antlogfd=-1; + break; + } + rc=read(antlogfd,&currpos, sizeof(currpos)); + if (sizeof(currpos) != rc) break; + + if ( (currpos<1024) || + (currpos>(endpos-4000)) ) currpos=1024; + rc=lseek (antlogfd, currpos, SEEK_SET); + if (currpos != rc) { + close(antlogfd); + antlogfd=-1; + break; + } + + rc=write(antlogfd, "===ANT-LOG===:", 14); + if (rc>0) currpos+=rc; + /* XXX also need to label with length */ + rc=writev(antlogfd, iov, 6); + if (rc>0) currpos+=rc; + + if (currpos > (endpos-4000)) currpos=1024; + lseek (antlogfd, 0, SEEK_SET); /* rewind */ + write(antlogfd,&currpos, sizeof(currpos)); + fsync(antlogfd); + break; + } + } if (writev(f->f_file, iov, 6) < 0) { int e = errno;