Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37046911
en ru br
ALT Linux repositórios
S:2.4.7-alt1
5.0: 1.3.10-alt1
4.1: 1.3.10-alt0.M41.4
+updates:1.3.9-alt1.M41.1
4.0: 1.2.12-alt6.M40.9
+updates:1.2.12-alt6.M40.8
3.0: 1.1.20-alt14.1

Group :: Sistema/Servidores
RPM: cups

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: FC-usb-paperout.patch
Download


diff -up cups-1.5b1/backend/usb-unix.c.usb-paperout cups-1.5b1/backend/usb-unix.c
--- cups-1.5b1/backend/usb-unix.c.usb-paperout	2011-05-24 15:51:39.000000000 +0200
+++ cups-1.5b1/backend/usb-unix.c	2011-05-24 15:51:39.000000000 +0200
@@ -30,6 +30,11 @@
 
 #include <sys/select.h>
 
+#ifdef __linux
+#include <sys/ioctl.h>
+#include <linux/lp.h>
+#endif /* __linux */
+
 
 /*
  * Local functions...
@@ -334,7 +339,19 @@ open_device(const char *uri,		/* I - Dev
   if (!strncmp(uri, "usb:/dev/", 9))
 #ifdef __linux
   {
-    return (open(uri + 4, O_RDWR | O_EXCL));
+    fd = open(uri + 4, O_RDWR | O_EXCL);
+
+    if (fd != -1)
+    {
+     /*
+      * Tell the driver to return from write() with errno==ENOSPACE
+      * on paper-out.
+      */
+      unsigned int t = 1;
+      ioctl (fd, LPABORT, &t);
+    }
+
+    return fd;
   }
   else if (!strncmp(uri, "usb://", 6))
   {
@@ -400,7 +417,14 @@ open_device(const char *uri,		/* I - Dev
         if (!strcmp(uri, device_uri))
 	{
 	 /*
-	  * Yes, return this file descriptor...
+	  * Yes, tell the driver to return from write() with
+	  * errno==ENOSPACE on paper-out.
+	  */
+	  unsigned int t = 1;
+	  ioctl (fd, LPABORT, &t);
+
+	 /*
+	  * Return this file descriptor...
 	  */
 
 	  fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n",
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009