Re: [Nagios-devel] [patch] FreeBSD fix for cfg_dir Re: Bug: cfg_dir

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] [patch] FreeBSD fix for cfg_dir Re: Bug: cfg_dir

Post by Guest »

Jan Grant wrote:
>
> Attached is a patch against nagios-2.10 which detects the "missing"
> _DIRENT_HAVE_D_TYPE on BSD systems (the heuristic is to look for
> DT_UNKNOWN) and defines it in those cases.
>

The patch looks decent, but it's the wrong fix. When d_type is present,
Nagios will still stat() the dirent to see if it's a directory before
recursing into it. A more proper fix would be to ignore d_type and
just rely on S_ISDIR(st.st_mode) to check for directories.

That'll make it work the same on every system too, which is most
definitely a Good Thing(tm).

I'll get to work on this when I have time, although I fear it won't
be until I've completed my current project at work and then have
looked into the config parsing code and the event-queue problems.

A Nagios hackathon would be a neat idea, and small stuff like this
could get sorted in no-time. Hmm, perhaps I shall see if I can get
the boss to sponsor one :-)

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked