rpms/cups/F-12 cups-sidechannel-intrs.patch, NONE, 1.1 cups.spec, 1.554, 1.555

Tim Waugh twaugh at fedoraproject.org
Tue Dec 8 11:12:00 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/cups/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21119

Modified Files:
	cups.spec 
Added Files:
	cups-sidechannel-intrs.patch 
Log Message:
* Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
- Use upstream patch to fix interrupt handling in the side-channel
  APIs (rev 8896).


cups-sidechannel-intrs.patch:
 sidechannel.c |   43 ++++++++++++++++++-------------------------
 1 file changed, 18 insertions(+), 25 deletions(-)

--- NEW FILE cups-sidechannel-intrs.patch ---
diff -up cups-1.4.2/cups/sidechannel.c.sidechannel-intrs cups-1.4.2/cups/sidechannel.c
--- cups-1.4.2/cups/sidechannel.c.sidechannel-intrs	2009-09-23 00:20:35.000000000 +0100
+++ cups-1.4.2/cups/sidechannel.c	2009-12-08 11:08:15.297539377 +0000
@@ -116,6 +116,7 @@ cupsSideChannelRead(
   char		buffer[16388];		/* Message buffer */
   int		bytes;			/* Bytes read */
   int		templen;		/* Data length from message */
+  int		nfds;			/* Number of file descriptors */
 #ifdef HAVE_POLL
   struct pollfd	pfd;			/* Poll structure for poll() */
 #else /* select() */
@@ -143,39 +144,31 @@ cupsSideChannelRead(
   pfd.fd     = CUPS_SC_FD;
   pfd.events = POLLIN;
 
-  if (timeout < 0.0)
-  {
-    if (poll(&pfd, 1, -1) < 1)
-      return (-1);
-  }
-  else if (poll(&pfd, 1, (long)(timeout * 1000)) < 1)
-    return (-1);
+  while ((nfds = poll(&pfd, 1, 
+		      timeout < 0.0 ? -1 : (long)(timeout * 1000))) < 0 &&
+	 (errno == EINTR || errno == EAGAIN))
+    ;
 
 #else /* select() */
   FD_ZERO(&input_set);
   FD_SET(CUPS_SC_FD, &input_set);
 
-  if (timeout < 0.0)
-  {
-    if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, NULL) < 1)
-    {
-      DEBUG_printf(("1cupsSideChannelRead: Select error: %s", strerror(errno)));
-      return (-1);
-    }
-  }
-  else
-  {
-    stimeout.tv_sec  = (int)timeout;
-    stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
+  stimeout.tv_sec  = (int)timeout;
+  stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
+
+  while ((nfds = select(CUPS_SC_FD + 1, &input_set, NULL, NULL, 
+			timeout < 0.0 ? NULL : &stimeout)) < 0 &&
+	 (errno == EINTR || errno == EAGAIN))
+    ;
 
-    if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, &stimeout) < 1)
-    {
-      DEBUG_puts("1cupsSideChannelRead: Select timeout");
-      return (-1);
-    }
-  }
 #endif /* HAVE_POLL */
 
+  if  (nfds < 1)
+  {
+    *status = nfds==0 ? CUPS_SC_STATUS_TIMEOUT : CUPS_SC_STATUS_IO_ERROR;
+    return (-1);
+  }
+
  /*
   * Read a side-channel message for the format:
   *


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/F-12/cups.spec,v
retrieving revision 1.554
retrieving revision 1.555
diff -u -p -r1.554 -r1.555
--- cups.spec	8 Dec 2009 11:05:54 -0000	1.554
+++ cups.spec	8 Dec 2009 11:12:00 -0000	1.555
@@ -65,6 +65,7 @@ Patch38: cups-str3439.patch
 Patch39: cups-str3440.patch
 Patch40: cups-str3442.patch
 Patch41: cups-negative-snmp-string-length.patch
+Patch42: cups-sidechannel-intrs.patch
 
 Patch100: cups-lspp.patch
 
@@ -235,6 +236,7 @@ module. 
 %patch39 -p1 -b .str3440
 %patch40 -p1 -b .str3442
 %patch41 -p1 -b .negative-snmp-string-length
+%patch42 -p1 -b .sidechannel-intrs
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -534,6 +536,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
+- Use upstream patch to fix interrupt handling in the side-channel
+  APIs (rev 8896).
 - Use upstream patch to handle negative SNMP string lengths (rev 8896).
 - Use upstream fix for SNMP detection (bug #542857, STR #3413).
 - Use the text filter for text/css files (bug #545026, STR #3442).




More information about the fedora-extras-commits mailing list