]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/scsi-irix.c
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / backend / scsi-irix.c
index 097071c23efb4e3532a454a524ef102e3c125382..b3b267651da40bc5b17a5f2bc457c1b5c6dd0efb 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * "$Id: scsi-irix.c 4703 2005-09-26 19:33:58Z mike $"
+ * "$Id: scsi-irix.c 6835 2007-08-22 18:34:34Z mike $"
  *
  *   IRIX SCSI printer support for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007 by Apple Inc.
  *   Copyright 2003-2005 by Easy Software Products, all rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or
@@ -95,7 +96,8 @@ print_device(const char *resource,    /* I - SCSI device */
 
   if (strncmp(resource, "/dev/scsi/", 10) != 0)
   {
-    fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
+    _cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
+                    resource);
     return (CUPS_BACKEND_STOP);
   }
 
@@ -103,6 +105,8 @@ print_device(const char *resource,  /* I - SCSI device */
   * Open the SCSI device file...
   */
 
+  fputs("STATE: +connecting-to-device\n", stderr);
+
   do
   {
     if ((scsi_fd = open(resource, O_RDWR | O_EXCL)) == -1)
@@ -116,8 +120,9 @@ print_device(const char *resource,  /* I - SCSI device */
        * available printer in the class.
        */
 
-        fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
-             stderr);
+        _cupsLangPuts(stderr,
+                     _("INFO: Unable to contact printer, queuing on next "
+                       "printer in class...\n"));
 
        /*
         * Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -130,20 +135,23 @@ print_device(const char *resource,        /* I - SCSI device */
 
       if (errno != EAGAIN && errno != EBUSY)
       {
-       fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
-               resource, strerror(errno));
+       _cupsLangPrintf(stderr,
+                       _("ERROR: Unable to open device file \"%s\": %s\n"),
+                       resource, strerror(errno));
        return (CUPS_BACKEND_FAILED);
       }
       else
       {
-        fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
-               resource);
+        _cupsLangPuts(stderr,
+                     _("INFO: Printer busy; will retry in 30 seconds...\n"));
         sleep(30);
       }
     }
   }
   while (scsi_fd == -1);
 
+  fputs("STATE: -connecting-to-device\n", stderr);
+
  /*
   * Now that we are "connected" to the port, ignore SIGTERM so that we
   * can finish out any page data the driver sends (e.g. to eject the
@@ -197,8 +205,9 @@ print_device(const char *resource,  /* I - SCSI device */
        if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
             scsi_req.ds_status != 0)
         {
-         fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
-                 scsi_req.ds_status);
+         _cupsLangPrintf(stderr,
+                         _("WARNING: SCSI command timed out (%d); "
+                           "retrying...\n"), scsi_req.ds_status);
           sleep(try + 1);
        }
        else
@@ -206,8 +215,8 @@ print_device(const char *resource,  /* I - SCSI device */
 
       if (try >= 10)
       {
-       fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
-               scsi_req.ds_status);
+       _cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
+                       scsi_req.ds_status);
         close(scsi_fd);
        return (CUPS_BACKEND_FAILED);
       }
@@ -227,5 +236,5 @@ print_device(const char *resource,  /* I - SCSI device */
 
 
 /*
- * End of "$Id: scsi-irix.c 4703 2005-09-26 19:33:58Z mike $".
+ * End of "$Id: scsi-irix.c 6835 2007-08-22 18:34:34Z mike $".
  */