service-log.c revision 59ee8d9c125b712d4549deffd480cce66f033749
/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "array.h"
#include "aqueue.h"
#include "hash.h"
#include "ioloop.h"
#include "fd-close-on-exec.h"
#include "fd-set-nonblock.h"
#include "service.h"
#include "service-process.h"
#include "service-process-notify.h"
#include "service-log.h"
#include <unistd.h>
{
struct log_service_handshake handshake;
i_error("pipe() failed: %m");
return -1;
}
if (ret < 0) {
i_error("write(log handshake) failed: %m");
return -1;
}
i_error("write(log handshake) didn't write everything");
return -1;
}
return 0;
}
static int
{
const char *data;
i_error("write(log process) failed: %m");
return -1;
}
return 0;
}
{
unsigned int i, count, n;
const char *log_prefix;
handshake_buf) < 0)
ret = -1;
else
n = 1;
for (i = 0; i < count; i++) {
continue;
handshake_buf) < 0) {
ret = -1;
break;
}
MASTER_LISTEN_FD_FIRST + n++;
}
if (ret < 0) {
return -1;
}
return 0;
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
"close(log_fd) failed: %m");
}
"close(log_fd) failed: %m");
}
}
}
i_error("close(master log fd) failed: %m");
i_error("close(master log fd) failed: %m");
}
}
struct service_list *service_list,
{
unsigned int i, n = 0, count;
/* master log fd is always the first one */
n++; *fd_count += 1;
for (i = 0; i < count; i++) {
continue;
n++; *fd_count += 1;
}
}