65 if (len > ll->
bufsz) {
110 const char *realpath = lf->
path+6;
115 if (stat(realpath, &sb) == 0)
116 if (S_ISREG(sb.st_mode) == 0)
123 SBuf basePath(realpath);
126 for (int16_t i = nRotate; i > 1;) {
193 if (ENOENT == xerrno && fatal_flag) {
194 fatalf(
"Cannot open '%s' because\n"
195 "\tthe parent directory does not exist.\n"
196 "\tPlease create the directory.\n", path);
197 }
else if (EACCES == xerrno && fatal_flag) {
198 fatalf(
"Cannot open '%s' for writing.\n"
199 "\tThe parent directory must be writeable by the\n"
200 "\tuser '%s', which is the cache_effective_user\n"
202 }
else if (EISDIR == xerrno && fatal_flag) {
203 fatalf(
"Cannot open '%s' because it is a directory, not a file.\n", path);
static void logfile_mod_stdio_writeline(Logfile *lf, const char *buf, size_t len)
static void logfile_mod_stdio_lineend(Logfile *lf)
static void logfile_mod_stdio_flush(Logfile *lf)
int logfile_mod_stdio_open(Logfile *lf, const char *path, size_t bufsz, int fatal_flag)
static void logfileWriteWrapper(Logfile *lf, const void *buf, size_t len)
static void logfile_mod_stdio_rotate(Logfile *lf, const int16_t nRotate)
static void logfile_mod_stdio_close(Logfile *lf)
static void logfile_mod_stdio_linestart(Logfile *)
LOGLINESTART * f_linestart
struct Logfile::@63 flags
SBuf & appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
#define debugs(SECTION, LEVEL, CONTENT)
void fatalf(const char *fmt,...)
void fd_bytes(const int fd, const int len, const IoDirection direction)
int FD_WRITE_METHOD(int fd, const char *buf, int len)
int file_open(const char *path, int mode)
bool FileRename(const SBuf &from, const SBuf &to)
void logfileFlush(Logfile *lf)
void * xcalloc(size_t n, size_t sz)
const char * xstrerr(int error)