istream-file.c revision 252db51b6c0a605163326b3ea5d09e9936ca3b29
/* Copyright (c) 2002-2003 Timo Sirainen */
/* @UNSAFE: whole file */
#include "lib.h"
#include "ioloop.h"
#include "istream-internal.h"
#include "network.h"
#include <time.h>
#include <unistd.h>
struct file_istream {
struct istream_private istream;
unsigned int file:1;
unsigned int autoclose_fd:1;
};
{
i_error("file_istream.close() failed: %m");
}
}
{
}
{
return -1;
/* remove the unused bytes from beginning of buffer */
} else if (stream->max_buffer_size == 0 ||
/* buffer is full - grow it */
}
return -2; /* buffer full */
}
ret = -1;
do {
} else {
size);
}
if (ret == 0) {
/* EOF */
return -1;
}
if (ret < 0) {
ret = 0;
} else {
return -1;
}
}
ret = 0;
} else {
}
}
return ret;
}
bool mark ATTR_UNUSED)
{
return;
}
}
}
{
/* can't do anything or data would be lost */
return;
}
}
static const struct stat *
{
i_error("file_istream.fstat() failed: %m");
return NULL;
}
}
}
bool autoclose_fd)
{
struct file_istream *fstream;
/* if it's a file, set the flags properly */
}
}