MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdOpenConfFile

Function cupsdOpenConfFile

scheduler/file.c:216–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 */
215
216cups_file_t * /* O - File pointer */
217cupsdOpenConfFile(const char *filename) /* I - Filename */
218{
219 cups_file_t *fp; /* File pointer */
220
221
222 if ((fp = cupsFileOpen(filename, "r")) == NULL)
223 {
224 if (errno == ENOENT)
225 {
226 /*
227 * Try opening the backup file...
228 */
229
230 char oldfile[1024]; /* filename.O */
231
232 snprintf(oldfile, sizeof(oldfile), "%s.O", filename);
233 fp = cupsFileOpen(oldfile, "r");
234 }
235 else
236 cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to open \"%s\": %s", filename,
237 strerror(errno));
238 }
239
240 return (fp);
241}
242
243
244/*

Callers 6

cupsdLoadJobFunction · 0.85
load_job_cacheFunction · 0.85
cupsdLoadAllClassesFunction · 0.85
cupsdLoadAllPrintersFunction · 0.85
cupsdUpdatePrinterPPDFunction · 0.85

Calls 2

cupsFileOpenFunction · 0.85
cupsdLogMessageFunction · 0.85

Tested by

no test coverage detected