Skip to content

Commit

Permalink
scheduler/conf.c: Print to stderr if we don't open cups-files.conf
Browse files Browse the repository at this point in the history
In case cupsd can't open the cups-files.conf, the error message is lost
if journal and syslog don't exist or work on system (usually in
containers).

Log the error into stderr at this place to get the error message if
needed.
  • Loading branch information
zdohnal committed Aug 29, 2023
1 parent 9d57699 commit 4866876
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scheduler/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,7 @@ cupsdReadConfiguration(void)
cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile);
else
{
#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
sd_journal_print(LOG_ERR, "Unable to open \"%s\" - %s", CupsFilesFile, strerror(errno));
#else
syslog(LOG_LPR, "Unable to open \"%s\" - %s", CupsFilesFile, strerror(errno));
#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
fprintf(stderr, "Unable to read \"%s\" - \"%s\".\n", CupsFilesFile, strerror(errno));

return (0);
}
Expand Down

0 comments on commit 4866876

Please sign in to comment.