cupsGetJobs() does not return an error #569

Closed
michaelrsweet opened this Issue Feb 9, 2004 · 4 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Feb 9, 2004

Version: 1.1.20
CUPS.org User: dominik.kubla.sciobyte

While developing a monitoring application, i discovered that cupsGetJobs() does not distinguish between no jobs being present and not being able to connect to cupsd to get the information. This is bad.

Checking the source from lpstat, it is obvious that it does not use cupsGetJobs exactly because this function does no error handling.

The following should be done to fix this: cupsGetJobs() should return -1 if an error occured and set an error variable containing more information.

Since the current documentation only defines return values greater than 0, this change should have little or no impact on existing code.

Collaborator

michaelrsweet commented Feb 9, 2004

CUPS.org User: mike

I agree that we should return -1 on error; will update in the 1.1.21 and 1.2 releases.

Collaborator

michaelrsweet commented Feb 9, 2004

CUPS.org User: dominik.kubla.sciobyte

Great! Thanks a lot.

BTW. Is it possible to query the job-originating-hostname from the CUPS
API? cups_job_t apparently does not contain this information.

Collaborator

michaelrsweet commented Feb 17, 2004

CUPS.org User: mike

It is possible to query the job-originating-hostname attribute using the cupsDoRequest() function.

Collaborator

michaelrsweet commented Feb 17, 2004

CUPS.org User: mike

Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment