Thanks, applied. On Fri, 2011-11-18 at 15:13 +0100, Gergely Nagy wrote:
Since IOV_MAX is not defined on Hurd its usage is made conditional. Errors are handled by g_malloc0() which aborts on failure, so no return value has to be checked.
Reported-By: Svante Signell <svante.signell@telia.com> Patch-From: Svante Signell <svante.signell@telia.com> Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- lib/logproto.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/logproto.c b/lib/logproto.c index 282064c..16ca0d7 100644 --- a/lib/logproto.c +++ b/lib/logproto.c @@ -420,9 +420,11 @@ log_proto_file_writer_new(LogTransport *transport, gint flush_lines) if (flush_lines == 0) /* the flush-lines option has not been specified, use a default value */ flush_lines = 1; +#ifdef IOV_MAX if (flush_lines > IOV_MAX) /* limit the flush_lines according to the current platform */ flush_lines = IOV_MAX; +#endif
/* allocate the structure with the proper number of items at the end */ LogProtoFileWriter *self = (LogProtoFileWriter *)g_malloc0(sizeof(LogProtoFileWriter) + sizeof(struct iovec)*flush_lines);
-- Bazsi