iostream-temp.c revision cf636afb3826f0d8e15c248aa1fc04ce72820e08
/* Copyright (c) 2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "str.h"
#include "safe-mkstemp.h"
#include "write-full.h"
#include "istream.h"
#include "ostream-private.h"
#include "iostream-temp.h"
#include <unistd.h>
struct temp_ostream {
struct ostream_private ostream;
char *temp_path_prefix;
int fd;
bool fd_tried;
};
{
}
{
return -1;
return -1;
}
return -1;
}
return -1;
}
return 0;
}
static ssize_t
{
unsigned int i;
for (i = 0; i < iov_count; i++) {
return -1;
}
}
return bytes;
}
static ssize_t
{
unsigned int i;
for (i = 0; i < iov_count; i++) {
if (o_stream_temp_move_to_fd(tstream) == 0) {
iov_count-i);
}
/* failed to move to temp fd, just keep it in memory */
}
}
return ret;
}
{
struct temp_ostream *tstream;
return output;
}
{
buffer_free(&buf);
}
{
struct temp_ostream *tstream =
} else {
}
return input;
}