Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler/conf.c: Print to stderr if we don't open cups-files.conf #777

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Aug 23, 2023

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.

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to change this, we might as well include the error message (strerror).

@zdohnal
Copy link
Member Author

zdohnal commented Aug 29, 2023

Updated.

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor tweak needed, then good to go.

scheduler/conf.c Outdated
#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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for quotes around the error message, nor the trailing period (since the error message usually has that). Otherwise OK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

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.
Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zdohnal zdohnal merged commit b7a60b8 into OpenPrinting:master Sep 4, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants