Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] milter-greylist 2.1.11

2006-08-02 by Hajimu UMEMOTO

Hi,

>>>>> On Tue, 1 Aug 2006 21:29:25 +0200
>>>>> manu@... said:

manu> Why is that one required? 

manu> I was about to make that change in the code:

manu> #ifdef HAVE_RES_NINIT
manu> #define RES_NINIT(res)  res_ninit(res)
manu> #else
manu> #define RES_NINIT(res) \
manu>         ((_res.options & RES_INIT) == 0 && res_init())
manu> #endif

manu> #ifdef HAVE_RES_NDESTROY
manu> # define RES_NDESTROY(res)      res_ndestroy(res)
manu> #else
manu> # ifdef HAVE_RES_NCLOSE
manu> #  define RES_NDESTROY(res)     res_nclose(res)
manu> # else
manu> #  define RES_NDESTROY(res)
manu> # endif
manu> #endif


manu> And use the macro like this:

manu>         if (RES_NINIT(res) != 0) {
manu>                 ...
manu>         }

The return value of res_ninit() was not tested, but is tested now.

	res_ninit(&res) != 0

is expand to

	((_res.options & RES_INIT) == 0 && res_init()) != 0

It is not same with

	(_res.options & RES_INIT) == 0 && res_init() != 0

exactly.  As far as testing if the return value of res_ninit() is 0 or
not, they come to same result.  However, it is slightly tricky.  In
anyway, the current code is valid.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@...  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.