From nobody@FreeBSD.org  Thu Nov 22 00:53:25 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id DBBA637B405
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Nov 2001 00:53:24 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id fAM8rOL10679;
	Thu, 22 Nov 2001 00:53:24 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200111220853.fAM8rOL10679@freefall.freebsd.org>
Date: Thu, 22 Nov 2001 00:53:24 -0800 (PST)
From: Koen Schreel <k.r.a.m.schreel@tue.nl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: doscmd fails to run properly when compiled without X-support but running under X
X-Send-Pr-Version: www-1.0

>Number:         32180
>Category:       bin
>Synopsis:       doscmd fails to run properly when compiled without X-support but running under X
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 22 01:00:01 PST 2001
>Closed-Date:    Tue Dec 4 04:57:51 PST 2001
>Last-Modified:  Tue Dec 04 04:59:10 PST 2001
>Originator:     Koen Schreel
>Release:        4.4-STABLE as of nov 20
>Organization:
Eindhoven University of Technology
>Environment:
FreeBSD diabolo.wop.wtb.tue.nl 4.4-STABLE FreeBSD 4.4-STABLE #1: Wed Nov 21 12:38:42 CET 2001     koens@diabolo.wop.wtb.tue.nl:/usr/obj/usr/src/sys/DIABOLO  i386
>Description:
When doscmd is compiled without X-support (by setting the NO_X 
environment variable), code remains that still sets xmode=1
when running the program under X (i.e. the DISPLAY environment
variable is set in the shell).

>How-To-Repeat:

>Fix:
The code can be found at line 138 and 139 of 
/usr/src/usr.bin/doscmd/doscmd.c. I see two ways of fixing the
problem:

(1) surround the code by an #ifndef NO_X #endif pair
(2) discard the two lines entirely

Option (2) is my favourite because there is no way of getting 
non-X output with X-support compiled in and running under X (unless 
the DISPLAY variable is unset). This is a big disadvantage when using
doscmd in scripts since in xmode, when the dos program finishes, 
doscmd does not. An alternative would be to include a command line 
option to switch xmode off explicitly.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tg 
State-Changed-When: Tue Dec 4 04:57:51 PST 2001 
State-Changed-Why:  
Fixed in -current and -stable (I took option 2). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32180 
>Unformatted:
