filelog: Ignore flush_line option if setlinebuf() not supported

This commit is contained in:
Martin Willi 2013-10-29 10:58:39 +01:00
parent efcf249aeb
commit b9dca7057c
2 changed files with 3 additions and 1 deletions

View File

@ -568,7 +568,7 @@ AC_CHECK_FUNC(
)
AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r)
AC_CHECK_FUNCS(fmemopen funopen mmap memrchr syslog)
AC_CHECK_FUNCS(fmemopen funopen mmap memrchr syslog setlinebuf)
AC_CHECK_HEADERS(sys/sockio.h glob.h net/if_tun.h linux/fib_rules.h)
AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)

View File

@ -214,10 +214,12 @@ METHOD(file_logger_t, open_, void,
this->filename, strerror(errno));
return;
}
#ifdef HAVE_SETLINEBUF
if (flush_line)
{
setlinebuf(file);
}
#endif /* HAVE_SETLINEBUF */
}
this->lock->write_lock(this->lock);
close_file(this);