Lines Matching defs:file
57 char *file; /* mmap cache file name */
58 int fd; /* file descriptor */
133 char *file = NULL;
148 file = talloc_asprintf(tmp_ctx, "%s_%s",
149 mc_ctx->file, "corrupted");
150 if (file == NULL) {
156 fd = creat(file, 0600);
160 "Failed to open file '%s' [%d]: %s\n",
161 file, err, strerror(err));
180 "Stored copy of corrupted mmap cache in file '%s\n'", file);
185 err = unlink(file);
189 "Failed to remove file '%s': %s.\n", file,
1077 * When we (re)create a new file we must mark the current file as recycled
1079 * We unlink the current file and make a new one
1089 ofd = open(mc_ctx->file, O_RDWR);
1094 "Failed to lock file %s.\n", mc_ctx->file);
1098 DEBUG(SSSDBG_FATAL_FAILURE, "Failed to mark mmap file %s as"
1100 mc_ctx->file, ret, strerror(ret));
1107 "Failed to open old memory cache file %s: %d(%s).\n",
1108 mc_ctx->file, ret, strerror(ret));
1112 ret = unlink(mc_ctx->file);
1115 DEBUG(SSSDBG_TRACE_FUNC, "Failed to rm mmap file %s: %d(%s)\n",
1116 mc_ctx->file, ret, strerror(ret));
1119 /* temporarily relax umask as we need the file to be readable
1124 mc_ctx->fd = open(mc_ctx->file, O_CREAT | O_EXCL | O_RDWR, 0644);
1128 DEBUG(SSSDBG_CRIT_FAILURE, "Failed to open mmap file %s: %d(%s)\n",
1129 mc_ctx->file, ret, strerror(ret));
1136 "Failed to lock file %s.\n", mc_ctx->file);
1144 uret = unlink(mc_ctx->file);
1147 DEBUG(SSSDBG_TRACE_FUNC, "Failed to rm mmap file %s: %d(%s)\n",
1148 mc_ctx->file, uret, strerror(uret));
1165 /* no reason to update anything else if the file is recycled or
1194 "Failed to unmap old memory cache file."
1204 "Failed to close old memory cache file."
1252 mc_ctx->file = talloc_asprintf(mc_ctx, "%s/%s",
1254 if (!mc_ctx->file) {
1275 /* for now ALWAYS create a new file on restart */
1285 DEBUG(SSSDBG_CRIT_FAILURE, "Failed to resize file %s: %d(%s)\n",
1286 mc_ctx->file, ret, strerror(ret));
1295 DEBUG(SSSDBG_CRIT_FAILURE, "Failed to mmap file %s(%zu): %d(%s)\n",
1296 mc_ctx->file, mc_ctx->mmap_size,
1322 /* Closing the file descriptor and ummaping the file
1324 if (mc_ctx && mc_ctx->file && mc_ctx->fd != -1) {
1325 dret = unlink(mc_ctx->file);
1329 "Failed to rm mmap file %s: %d(%s)\n", mc_ctx->file,