{
static unsigned int counter = 0;
const char *timestamp, *prefix;
- struct stat st;
int ret;
if ((ret = iostream_rawlog_try_create_tcp(dir, input, output)) != 0)
return ret < 0 ? -1 : 0;
- if (stat(dir, &st) < 0) {
- if (errno != ENOENT && errno != EACCES)
- i_error("rawlog: stat(%s) failed: %m", dir);
- return -1;
- }
timestamp = t_strflocaltime("%Y%m%d-%H%M%S", ioloop_time);
in_path = t_strdup_printf("%s.in", prefix);
in_fd = open(in_path, O_CREAT | O_APPEND | O_WRONLY, 0600);
if (in_fd == -1) {
- i_error("creat(%s) failed: %m", in_path);
+ if (errno != ENOENT && !ENOACCESS(errno))
+ i_error("rawlog: creat(%s) failed: %m", in_path);
return -1;
}
out_path = t_strdup_printf("%s.out", prefix);
out_fd = open(out_path, O_CREAT | O_APPEND | O_WRONLY, 0600);
if (out_fd == -1) {
- i_error("creat(%s) failed: %m", out_path);
+ if (errno != ENOENT && !ENOACCESS(errno))
+ i_error("rawlog: creat(%s) failed: %m", out_path);
i_close_fd(&in_fd);
i_unlink(in_path);
return -1;
return ret < 0 ? -1 : 0;
fd = open(path, O_CREAT | O_APPEND | O_WRONLY, 0600);
if (fd == -1) {
- i_error("creat(%s) failed: %m", path);
+ if (errno != ENOENT && !ENOACCESS(errno))
+ i_error("rawlog: creat(%s) failed: %m", path);
return -1;
}
iostream_rawlog_create_fd(fd, path, input, output);