configure.in needs "getutent" added to its AC_CHECK_FUNCS(). Otherwise, HAVE_GETUTENT doesn't get defined in config.h and util.c uses its own implementation of getutent instead of the system's. That's a problem with modern GNU C Library because the utmp database format has changed. (There's a complicated backward compatibility facility that can maintain a shadow database in the old format, but I don't use it). BTW, I recommend not using a standard function name for a local function. E.g. in this case, the local version of getutent is called getutent. That misled me for a while, because I assumed syslog-ng was actually calling standard getutent. It would be better for it to call syslogng_getutent() and have that call the real getutent() if it's available. -- Bryan Henderson San Jose, California
On Sun, 2007-01-28 at 02:54 +0000, Bryan Henderson wrote:
configure.in needs "getutent" added to its AC_CHECK_FUNCS(). Otherwise, HAVE_GETUTENT doesn't get defined in config.h and util.c uses its own implementation of getutent instead of the system's.
Thanks, I've added the check.
That's a problem with modern GNU C Library because the utmp database format has changed. (There's a complicated backward compatibility facility that can maintain a shadow database in the old format, but I don't use it).
BTW, I recommend not using a standard function name for a local function. E.g. in this case, the local version of getutent is called getutent. That misled me for a while, because I assumed syslog-ng was actually calling standard getutent. It would be better for it to call syslogng_getutent() and have that call the real getutent() if it's available.
I don't want to add #ifdefs to the calling side of things. I know I could use macros, but then the calling side would not indicate that there's a private function implemented. I've added a comment though. -- Bazsi
participants (2)
-
Balazs Scheidler
-
bryanh@giraffe-data.com