istream-unix.c revision d17a99d9e1c314333d0118228ebb02ee9d60b4f1
/* Copyright (c) 2014-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "fdpass.h"
#include "istream-file-private.h"
#include "istream-unix.h"
struct unix_istream {
struct file_istream fstream;
bool next_read_fd;
int read_fd;
};
static void
{
}
{
if (!ustream->next_read_fd)
return i_stream_file_read(stream);
return -2;
do {
if (ret == 0) {
/* EOF */
return -1;
}
return 0;
} else {
/* if we get EBADF for a valid fd, it means something's
really wrong and we'd better just crash. */
return -1;
}
}
return ret;
}
{
struct unix_istream *ustream;
return input;
}
{
struct unix_istream *ustream =
}
{
struct unix_istream *ustream =
}
{
struct unix_istream *ustream =
int fd;
return fd;
}