From underway@comcast.net  Wed Mar  3 14:34:59 2004
Return-Path: <underway@comcast.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 76D9216A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Mar 2004 14:34:59 -0800 (PST)
Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 56B9643D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Mar 2004 14:34:59 -0800 (PST)
	(envelope-from underway@comcast.net)
Received: from localhost.localdomain (c-24-17-47-224.client.comcast.net[24.17.47.224])
          by comcast.net (rwcrmhc12) with ESMTP
          id <2004030322345801400816s8e>; Wed, 3 Mar 2004 22:34:58 +0000
Received: from localhost.localdomain (localhost [127.0.0.1])
	by localhost.localdomain (8.12.11/8.12.11) with ESMTP id i23MabYQ027903
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 3 Mar 2004 14:36:38 -0800 (PST)
	(envelope-from underway@comcast.net)
Received: (from jojo@localhost)
	by localhost.localdomain (8.12.11/8.12.11/Submit) id i23MaWlI027902;
	Wed, 3 Mar 2004 14:36:32 -0800 (PST)
	(envelope-from underway@comcast.net)
Message-Id: <61wu61h828.u61@mail.comcast.net>
Date: Wed, 03 Mar 2004 14:36:31 -0800
From: "Gary W. Swearingen" <underway@comcast.net>
Reply-To: underway@comcast.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: lptcontrol.c has unused PATH_LPCTL definition.
X-GNATS-Notify:

>Number:         63718
>Category:       bin
>Synopsis:       lptcontrol.c has unused PATH_LPCTL definition.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 03 14:40:16 PST 2004
>Closed-Date:    Fri Oct 01 20:19:02 GMT 2004
>Last-Modified:  Fri Oct 01 20:19:02 GMT 2004
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
none
>Environment:
n/a
>Description:

lptcontrol.c has unused PATH_LPCTL definition.

>How-To-Repeat:
n/a

>Fix:

--- lptcontrol.c.orig	Sat May  3 14:06:37 2003
+++ lptcontrol.c	Wed Mar  3 13:52:10 2004
@@ -46,7 +46,6 @@
 #include <sys/types.h>
 
 
-#define PATH_LPCTL	_PATH_DEV "lpctl"
 #define DEFAULT_DEVICE	_PATH_DEV "lpt0"
 #define IRQ_INVALID	-1
 #define DO_POLL		0
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: "Gary W. Swearingen" <underway@comcast.net>
Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Subject: Re: bin/63718: lptcontrol.c has unused PATH_LPCTL definition.
Date: Thu, 4 Mar 2004 18:42:28 +1100 (EST)

 On Wed, 3 Mar 2004, Gary W. Swearingen wrote:
 
 > >Description:
 >
 > lptcontrol.c has unused PATH_LPCTL definition.
 
 Not using it is the bug.  From lptcontrol(4):
 
 % ...
 %      -d device
 %              Set the mode of the printer device specified by device.  The
 %              default value for device is /dev/lpt0.
 
 The default should be the control device, but rev.1.7 of lptcontrol.c
 broke this.  The data device a completely bogus default for the control
 program.  Using it sometimes causes lptcontrol to hang or have undesirable
 side effects.  You can work around this by specifying the control device
 using -d and never using the default, but this shouldn't be necessary.
 
 % FILES
 %      /dev/lpt?               printer devices
 %      /dev/lpctl?             printer control devices
 
 The name of the control devices is documented here.  This is also
 broken in -current.  The device name has 1 spelling error and 2 lexical
 errors in devfs ("lpctl0" became "lpt0.ctl").
 
 Both MAKEDEV and devfs are missing support for the all but 2 of the 64
 mostly-undocumented subdevices per minor.  You can encode auto-linefeed
 and 5 other attributes in the minor number.  One of the attributes is
 LP_BYPASS, whose comment says that it is to bypass printer-ready checks
 but which actually encodes being a control device, so there are only 33
 useful subdevices per minor (32 data ones and 1 control one).  devfs
 only creates 2 of these.
 
 Bruce

From: Bruce Evans <bde@zeta.org.au>
To: "Gary W. Swearingen" <underway@comcast.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/63718: lptcontrol.c has unused PATH_LPCTL definition.
Date: Sat, 6 Mar 2004 03:26:14 +1100 (EST)

 [Qouting everything since so that it gets sent to gnats]
 
 On Thu, 4 Mar 2004, Gary W. Swearingen wrote:
 
 > Thanks Bruce.  Some of that went over my head, but here's a
 > replacement patch that seems to work.  (My use of the stock lptcontrol
 > was giving "lptcontrol: open: Device busy" which the patch fixes.)  I
 > slipped in an improvement (?) to the "usage" string.
 >
 > I tested (?) it by "making" it an running the new program without
 > error, but I know of no way to determine whether it actually changed
 > lpt0's mode.
 >
 > I'll file another PR on the manpage's FILES section later.
 >
 > --- lptcontrol.c.orig	Sat May  3 14:06:37 2003
 > +++ lptcontrol.c	Thu Mar  4 09:06:06 2004
 > @@ -46,8 +46,7 @@
 >  #include <sys/types.h>
 >
 >
 > -#define PATH_LPCTL	_PATH_DEV "lpctl"
 > -#define DEFAULT_DEVICE	_PATH_DEV "lpt0"
 > +#define DEFAULT_DEVICE	_PATH_DEV "lpt0.ctl"
 >  #define IRQ_INVALID	-1
 >  #define DO_POLL		0
 >  #define USE_IRQ		1
 > @@ -56,7 +55,7 @@
 >
 >  static void usage(void)
 >  {
 > -	fprintf(stderr, "usage: lptcontrol -i | -p | -s | -e [-d device]\n");
 > +	fprintf(stderr, "usage: lptcontrol -i | -p | -s | -e [-d lpt-control-device]\n");
 >  	exit(1);
 >  }
 >
 
 Yes, that seems to be all that is necessary.  But I want to change devfs
 name to be the same as in RELENG_4 ("lpctl0").  Then no changes would be
 needed to the man page.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Fri Oct 1 20:18:22 GMT 2004 
State-Changed-Why:  
Heaps of bit rot were removed in a general overhaul. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63718 
>Unformatted:
