Lines Matching defs:path

292     char *path;     /* allocated path, e.g. "/var/log/foo" or "foo" */
293 char *end; /* end of path, for appending suffices such as ".gz" */
344 on failure, usually due to an access restriction or invalid path. Note that
354 while ((fd = open(log->path, O_CREAT | O_EXCL, 0644)) < 0) {
357 if (stat(log->path, &st) == 0 && time(NULL) - st.st_mtime > PATIENCE) {
358 unlink(log->path);
364 if (stat(log->path, &st) == 0)
377 utimes(log->path, NULL);
378 if (stat(log->path, &st) == 0)
389 if (stat(log->path, &st) || st.st_mtime != log->lock)
401 unlink(log->path);
560 unlink(log->path); /* ignore error, since may not exist */
578 unlink(log->path); /* ignore error, since may not exist */
583 dest = malloc(strlen(log->path) + 1);
586 strcpy(dest, log->path);
588 ret = rename(log->path, dest);
629 fd = open(log->path, O_RDONLY, 0);
725 rec = fopen(log->path, "a");
751 if (stat(log->path, &st) == 0 && st.st_size) {
758 if ((fd = open(log->path, O_RDONLY, 0)) < 0) {
829 log->fd = open(log->path, O_RDWR | O_CREAT, 0644);
844 unlink(log->path);
865 gzlog *gzlog_open(char *path)
871 if (path == NULL || *path == 0)
881 /* save path and end of path for name construction */
882 n = strlen(path);
883 log->path = malloc(n + 9); /* allow for ".repairs" */
884 if (log->path == NULL) {
888 strcpy(log->path, path);
889 log->end = log->path + n;
894 free(log->path);
953 fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
963 fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
1014 fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
1054 if (log->path != NULL)
1055 free(log->path);