Re: [syslog-ng] HAVE_GETUTENT not defined
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. ...
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'm with you on that, but I was suggesting something different. There is today an #ifdef in utils.c like this: ...
But how would the calling site look like?
Today, it's: while ((ut = getutent())) In my scheme, it's: while ((ut = my_getutent())) (on a system that has standard getutent(), my_getutent() is implemented as a call to the system's getutent()). -- Bryan Henderson San Jose, California
On Wed, 2007-01-31 at 22:10 +0000, Bryan Henderson wrote:
> 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. ...
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'm with you on that, but I was suggesting something different. There is today an #ifdef in utils.c like this: ...
But how would the calling site look like?
Today, it's:
while ((ut = getutent()))
In my scheme, it's:
while ((ut = my_getutent()))
(on a system that has standard getutent(), my_getutent() is implemented as a call to the system's getutent()).
That's what I thought. This is the solution I don't really like, I don't really like maintaining wrappers for calls that are present nearly every platform, because wrappers like my_getutent() makes the code less readable for me, even if it indeed makes the code more readable for others. I think this is more about principle, than the case for getutent(), I don't like wrappers (I believe in layers but that's a different story), but this is probably a personal preference. -- Bazsi
participants (2)
-
Balazs Scheidler
-
bryanh@giraffe-data.com