From owner-freebsd-stable@FreeBSD.ORG Wed May 2 21:25:02 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D37C16A404 for ; Wed, 2 May 2007 21:25:02 +0000 (UTC) (envelope-from pvh@wfeet.za.net) Received: from ctb-mesg8.saix.net (ctb-mesg8.saix.net [196.25.240.78]) by mx1.freebsd.org (Postfix) with ESMTP id AF11E13C45D for ; Wed, 2 May 2007 21:24:59 +0000 (UTC) (envelope-from pvh@wfeet.za.net) Received: from leftside.wfeet.za.net (dsl-241-51-150.telkomadsl.co.za [41.241.51.150]) by ctb-mesg8.saix.net (Postfix) with ESMTP id F1DAD27BB for ; Wed, 2 May 2007 22:23:54 +0200 (SAST) Received: from leftside.wfeet.za.net (localhost [127.0.0.1]) by leftside.wfeet.za.net (Postfix) with ESMTP id CC9ED3015A for ; Wed, 2 May 2007 22:23:44 +0200 (SAST) X-Spam-Virus: No X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on leftside.wfeet.za.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 Received: from [192.168.0.1] (blackstar.wfeet.za.net [192.168.0.1]) by leftside.wfeet.za.net (Postfix) with ESMTP id 9BBCA30157 for ; Wed, 2 May 2007 22:23:44 +0200 (SAST) Message-ID: <4638F350.8090001@wfeet.za.net> Date: Wed, 02 May 2007 22:23:44 +0200 From: Peter van Heusden User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: freebsd-stable@freebsd.org X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (leftside.wfeet.za.net [0.0.0.0]); Wed, 02 May 2007 22:23:44 +0200 (SAST) Subject: cups + usb + FreeBSD 6-STABLE + tcgetattr() lockup X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2007 21:25:02 -0000 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