-
Notifications
You must be signed in to change notification settings - Fork 178
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
Conversation
There was a problem hiding this 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).
93e9991
to
4866876
Compare
Updated. |
There was a problem hiding this 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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1e6a89b
to
db9cecd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
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.