mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
getdata: add missing HAVE_POSIX_FADVISE protection
Reported-by: Conor McCarthy <mr.spuratic@gmail.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
631bf0bf7c
commit
48caf5fb42
1 changed files with 12 additions and 10 deletions
|
|
@ -202,16 +202,18 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
if (dhcpd_config == NULL) {
|
||||
err(EXIT_FAILURE, "parse_config: %s", config_file);
|
||||
}
|
||||
#ifdef POSIX_FADV_NOREUSE
|
||||
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_NOREUSE) != 0) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_NOREUSE */
|
||||
#ifdef POSIX_FADV_SEQUENTIAL
|
||||
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_SEQUENTIAL */
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
# ifdef POSIX_FADV_NOREUSE
|
||||
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_NOREUSE) != 0) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
# endif /* POSIX_FADV_NOREUSE */
|
||||
# ifdef POSIX_FADV_SEQUENTIAL
|
||||
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
# endif /* POSIX_FADV_SEQUENTIAL */
|
||||
#endif /* HAVE_POSIX_FADVISE */
|
||||
|
||||
/* Very hairy stuff begins. */
|
||||
while (unlikely(!feof(dhcpd_config))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue