Lines Matching refs:file

64 	ver = chan->out.file.versions;
72 if (strlen(chan->out.file.name) > (size_t)(PATH_MAX-3))
75 sprintf(old_name, "%s.%d", chan->out.file.name, ver-1);
76 sprintf(new_name, "%s.%d", chan->out.file.name, ver);
79 sprintf(new_name, "%s.0", chan->out.file.name);
80 (void)isc_movefile(chan->out.file.name, new_name);
98 if (chan->out.file.stream != NULL)
99 return (chan->out.file.stream);
101 if (stat(chan->out.file.name, &sb) < 0) {
105 chan->out.file.name, strerror(errno));
113 if (chan->out.file.versions) {
116 "log_open_stream: want versions but %s isn't a regular file",
117 chan->out.file.name);
128 (void)unlink(chan->out.file.name);
132 "log_open_stream: want truncation but %s isn't a regular file",
133 chan->out.file.name);
140 fd = open(chan->out.file.name, flags,
144 chan->out.file.name, strerror(errno));
154 (void) fchown(fd, chan->out.file.owner, chan->out.file.group);
156 chan->out.file.stream = stream;
168 stream = chan->out.file.stream;
169 chan->out.file.stream = NULL;
183 lcl->channel->out.file.stream != NULL &&
194 return (chan->out.file.stream);
203 return (chan->out.file.name);
385 stream = chan->out.file.stream;
391 if (chan->out.file.max_size != ULONG_MAX) {
397 chan->out.file.max_size) {
619 chan->out.file.name_size = ((len / 256) + 1) * 256;
620 chan->out.file.name = memget(chan->out.file.name_size);
621 if (chan->out.file.name == NULL) {
627 strcpy(chan->out.file.name, name);
629 chan->out.file.name_size = 0;
630 chan->out.file.name = NULL;
632 chan->out.file.stream = stream;
633 chan->out.file.versions = versions;
634 chan->out.file.max_size = max_size;
635 chan->out.file.owner = getuid();
636 chan->out.file.group = getgid();
647 chan->out.file.owner = owner;
648 chan->out.file.group = group;
705 chan->out.file.stream != NULL)
706 (void)fclose(chan->out.file.stream);
707 if (chan->out.file.name != NULL)
708 memput(chan->out.file.name,
709 chan->out.file.name_size);
716 /*! \file */