istream-file.c revision 4ae354df6e08998137b527f495bfaaf3daf9eddc
/* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */
/* @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;
unsigned int seen_eof:1;
};
{
i_error("file_istream.close() failed: %m");
}
}
{
return -2;
do {
/* don't try to read() again. EOF from keyboard (^D)
requires this to work right. */
ret = 0;
} else {
size);
}
if (ret == 0) {
/* EOF */
return -1;
}
ret = 0;
} else {
return -1;
}
}
ret = 0;
} else {
}
}
return ret;
}
bool mark ATTR_UNUSED)
{
i_panic("stream doesn't support seeking backwards");
}
}
{
/* 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 */
}
}