Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 May 2007 22:23:44 +0200
From:      Peter van Heusden <pvh@wfeet.za.net>
To:        freebsd-stable@freebsd.org
Subject:   cups + usb + FreeBSD 6-STABLE + tcgetattr() lockup
Message-ID:  <4638F350.8090001@wfeet.za.net>

next in thread | raw e-mail | index | archive | help
Hi. I've got a HP LaserJet 1010 attached to my FreeBSD 6.2 machine via
usb, on /dev/ulpt0. I recently upgraded CUPS, and after fixing the
permissions issues on /dev/ulpt0, I found that when I printed the usb
backend would just "hang", which turned out to be a block on tcgetattr()
on the ulpt0. The code in question is:

START CODE

 /*
  * Set any options provided...
  */

  tcgetattr(device_fd, &opts);

  opts.c_lflag &= ~(ICANON | ECHO | ISIG);      /* Raw mode */

  /**** No options supported yet ****/

  tcsetattr(device_fd, TCSANOW, &opts);

END CODE

As I see this, the code is switching the line discipline to raw on the
ulpt0 device. In any event, why is tcgetattr() blocking?

One solution could be to conditionally (on FreeBSD) only do a
tcsetattr(). I don't want to make any suggestions to the CUPS people
without first checking out what the "right" way to do this on FreeBSD
is, though. (The workaround, by the way, is to set the permissions on
/dev/ulpt0 so that it is write-only for user cups - then CUPS opens the
device write-only and the block doesn't happen).

Peter



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4638F350.8090001>