iostream-rawlog.c revision 4307c886579381dbb1897ea1388ae6978c96f560
/* Copyright (c) 2011-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hostpid.h"
#include "ioloop.h"
#include "write-full.h"
#include "time-util.h"
#include "istream.h"
#include "ostream.h"
#include "istream-rawlog.h"
#include "ostream-rawlog.h"
#include "iostream-private.h"
#include "iostream-rawlog-private.h"
#include "iostream-rawlog.h"
#include <unistd.h>
#include <fcntl.h>
static void
{
return;
i_error("rawlog_istream.write(%s) failed: %m",
}
}
{
(unsigned long)ioloop_timeval.tv_sec,
(unsigned int)ioloop_timeval.tv_usec) < 0)
i_unreached();
}
{
if (rstream->write_timestamp)
start = i;
}
}
}
{
i_error("rawlog_istream.close(%s) failed: %m",
}
}
}
{
static unsigned int counter = 0;
struct ostream *old_output;
counter++;
if (in_fd == -1) {
return -1;
}
if (out_fd == -1) {
i_close_fd(&in_fd);
return -1;
}
old_output = *output;
return 0;
}