]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/socket.c
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / backend / socket.c
index 70a0891954918059b1e774de9fdacf1d4a35f593..423000f0f64ab508a5eab507b64045a840ff1f8d 100644 (file)
@@ -73,6 +73,7 @@ main(int  argc,                               /* I - Number of command-line arguments (6 or 7) */
   int          print_fd;               /* Print file */
   int          copies;                 /* Number of copies to print */
   time_t       start_time,             /* Time of first connect */
+               current_time,           /* Current time */
                wait_time;              /* Time to wait before shutting down socket */
   int          recoverable;            /* Recoverable error shown? */
   int          contimeout;             /* Connection timeout */
@@ -417,8 +418,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
   */
 
   wait_time = time(NULL) + 5;
-  while (wait_time >= time(NULL))
-    if (wait_bc(device_fd, 1) <= 0)
+  while (wait_time >= time(&current_time))
+    if (wait_bc(device_fd, wait_time - current_time) <= 0)
       break;
 
   if (waiteof)