/*
-* "$Id: usb-darwin.c 6996 2007-09-28 18:30:31Z mike $"
+* "$Id: usb-darwin.c 6993 2007-09-28 18:05:28Z mike $"
*
-* Copyright � 2005-2007 Apple Inc. All rights reserved.
+* Copyright � 2005-2008 Apple Inc. All rights reserved.
*
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
* Inc. ("Apple") in consideration of your agreement to the following
if (errno != EAGAIN || errno != EINTR)
{
- perror("ERROR: Unable to read print data");
+ _cupsLangPrintError(_("ERROR: Unable to read print data"));
return CUPS_BACKEND_STOP;
}
if (!keepLooking && g.status_timer != NULL)
{
fputs("STATE: -offline-error\n", stderr);
- _cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
+ _cupsLangPuts(stderr, _("INFO: Printer is now online.\n"));
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
CFRelease(g.status_timer);
g.status_timer = NULL;
void *info)
{
fputs("STATE: +offline-error\n", stderr);
- _cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
+ _cupsLangPuts(stderr, _("INFO: Printer is currently offline.\n"));
+
+ if (getenv("CLASS") != NULL)
+ {
+ /*
+ * If the CLASS environment variable is set, the job was submitted
+ * to a class and not to a specific queue. In this case, we want
+ * to abort immediately so that the job can be requeued on the next
+ * available printer in the class.
+ *
+ * Sleep 5 seconds to keep the job from requeuing too rapidly...
+ */
+
+ sleep(5);
+
+ exit(CUPS_BACKEND_FAILED);
+ }
}
execv("/usr/libexec/cups/backend/usb", my_argv);
- perror("/usr/libexec/cups/backend/usb");
+ _cupsLangPrintError(_("ERROR: Unable to exec /usr/libexec/cups/backend/usb"));
exit(errno);
}
else if (child_pid < 0)
* Error - couldn't fork a new process!
*/
- perror("fork");
+ _cupsLangPrintError(_("ERROR: Unable to fork"));
exit(errno);
}
/*
- * End of "$Id: usb-darwin.c 6996 2007-09-28 18:30:31Z mike $".
+ * End of "$Id: usb-darwin.c 6993 2007-09-28 18:05:28Z mike $".
*/