Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37739710
en ru br
Репозитории ALT
S:3.23.8-alt1
5.1: 3.11.5-alt0.M51.1
4.1: 2.8.10-alt2.M41.1
4.0: 2.7.12-alt2.M40.1
+backports:2.8.10-alt2.M40.1
3.0:
+backports:1.6.6a-alt0.M30.4.1
www.altlinux.org/Changes

Группа :: Издательство
Пакет: hplip

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: fedora-2.7.12-4-hplip-media-empty.patch
Скачать


diff -up hplip-2.7.12/prnt/backend/hp.c.media-empty hplip-2.7.12/prnt/backend/hp.c
--- hplip-2.7.12/prnt/backend/hp.c.media-empty	2007-11-29 00:17:27.000000000 +0000
+++ hplip-2.7.12/prnt/backend/hp.c	2008-01-18 14:37:11.000000000 +0000
@@ -517,10 +517,12 @@ bugout:
 }
 
 /* Check printer status, if in an error state, loop until error condition is cleared. */
+/* XXX What if it is immediately replaced by a different error condition? XXX */
 static int loop_test(HPMUD_DEVICE dd, HPMUD_CHANNEL cd, struct pjl_attributes *pa, const char *uri, const char *job)
 {
-   int retry=0, status;
+   int status;
    const char *pstate;
+   const char *emitted_state_reason = NULL;
 
    while (1)
    {
@@ -529,27 +531,26 @@ static int loop_test(HPMUD_DEVICE dd, HP
 
       if (strcmp(pstate, "none")==0)
       {
-         if (retry)
+         if (emitted_state_reason)
          {
             /* Clear error. */
             device_event(uri, job, VSTATUS_PRNT, "event", 0);
             fputs("INFO: Printing...\n", stderr);
-            fprintf(stderr, "STATE: -%s\n", pstate);
-            retry=0;
+            fprintf(stderr, "STATE: -%s\n", emitted_state_reason);
          }
          break;   /* no error, done */
       }
 
-      if (!retry)
+      if (!emitted_state_reason)
       {
          /* Display error. */
          device_event(uri, job, status, "error", RETRY_TIMEOUT);
-         fprintf(stderr, "STATE: +%s\n", pstate);
+	 emitted_state_reason = pstate;
+         fprintf(stderr, "STATE: +%s\n", emitted_state_reason);
       }
 
       BUG("ERROR: %d %s; will retry in %d seconds...\n", status, pstate, RETRY_TIMEOUT);
       sleep(RETRY_TIMEOUT);
-      retry = 1;
    }
 
    return 0;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin