[syslog-ng] Compile Error for syslog-ng-1.1.30

Balazs Scheidler bazsi@balabit.hu
Fri, 6 Aug 1999 19:52:18 +0200


On Fri, Aug 06, 1999 at 02:28:19PM +0900, bazsi wrote:
> > > <       static utmp ut;
> > > ---
> > > >       static struct utmp ut;
> > 
> > getutent() emulation for systems which not have one is still broken in at
> > least one way. getutent() should return NULL when the EOF is reached.
> 
> Though I don't understand C language very well...
> 
> If read() read EOF then return (ssize_t)NULL. It's right.
> But, Can I hope stored NULL to &ut by read() at the time?

No. I have fixed it now. But Solaris should support getutent() calls, so you
don't need those routines. This is the correct getutent() call for those
interested:

struct utmp *getutent(void)
{
        static struct utmp ut;

        if (utent_fd == -1) {
                utent_fd = open(_PATH_UTMP, O_RDONLY | O_NOCTTY);
        }
        if (utent_fd == -1)
                return NULL;
        rc = read(utent_fd, &ut, sizeof(ut));
        if (rc <= 0) {
                close(utent_fd);
                utent_fd = -1;
                return NULL;
        }
        else {
                return &ut;
        }
}

> > Could you provide some messages before the first door_return call? Maybe in
> > a private message.
> 
> OK. The following is what I Executed commands.
> 
> # cp /dev/null /var/log/test.log
> # ls -l /var/log/test.log
> -rw-r--r--   1 root     other          0 Aug  6 13:41 /var/log/test.log
> # /usr/local/sbin/syslog-ng
> Terminated
> # su -
> # su -
> # ps -ef | grep syslog-ng
>     root 21724     1  0 13:43:29 ?        0:00 /usr/local/sbin/syslog-ng
> # cat /var/log/test.log
> Aug  6 13:43:29 src@sun1 syslog-ng[21724]: syslog-ng version 1.1.30 starting

I'd need a bit different truss outputs. 

1) Launch syslog-ng using the

truss -o syslog-ng.truss ./syslog-ng -dv
 
Using -dv will prevent forking.

2) While the previous truss is running, on a different terminal (or VT
session):

truss -o logger.truss logger "This is a message"

The files syslog-ng.truss and logger.truss is what I need.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt