Lines Matching refs:fp
69 static bool config_parse(FILE* fp, config_t* config);
102 FILE* fp = fopen(filename, "rt"); in config_new() local
103 if (!fp) { in config_new()
109 if (!config_parse(fp, config.get())) { in config_new()
113 fclose(fp); in config_new()
276 FILE* fp = nullptr; in config_save() local
297 fp = fopen(temp_filename.c_str(), "wt"); in config_save()
298 if (!fp) { in config_save()
313 if (fprintf(fp, "%s", serialized.str().c_str()) < 0) { in config_save()
320 if (fflush(fp) < 0) { in config_save()
328 if (fsync(fileno(fp)) < 0) { in config_save()
333 if (fclose(fp) == EOF) { in config_save()
338 fp = nullptr; in config_save()
373 if (fp) fclose(fp); in config_save()
391 FILE* fp = nullptr; in checksum_save() local
420 fp = fopen(temp_filename.c_str(), "rb"); in checksum_save()
421 if (!fp) { in checksum_save()
429 if (fsync(fileno(fp)) < 0) { in checksum_save()
434 if (fclose(fp) == EOF) { in checksum_save()
439 fp = nullptr; in checksum_save()
474 if (fp) fclose(fp); in checksum_save()
491 static bool config_parse(FILE* fp, config_t* config) { in config_parse() argument
492 CHECK(fp != nullptr); in config_parse()
500 while (fgets(line, sizeof(line), fp)) { in config_parse()