Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Reply-To: Cygwin List <cygwin@cygwin.com>
Message-Id: <6.0.1.1.0.20040324194546.03cadb00@127.0.0.1>
X-Sender: 
Date: Wed, 24 Mar 2004 19:48:00 -0500
To: "Curt Mills, WE7U" <archer@eskimo.com>, cygwin@cygwin.com
From: Larry Hall <cygwin-lh@cygwin.com>
Subject: Re: "test -c com1" hangs on some WinXP systems
In-Reply-To: <Pine.SUN.4.58.0403241328530.26969@eskimo.com>
References: <Pine.SUN.4.58.0403241253000.26969@eskimo.com> <Pine.SUN.4.58.0403241328530.26969@eskimo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

At 04:31 PM 3/24/2004, you wrote:
>On Wed, 24 Mar 2004, Curt, WE7U wrote:
>
>> Our application runs on multiple OS'es.  A few of our WinXP users
>> (and perhaps Win2k, can't remember) have had "if test -c com1" hang
>> during our configure stage.
>>
>> We've already figured out that we should be using "/dev/ttyS0"
>> instead of "com1", and have switched to that.  Because of the hang
>> we're trying "if test -d /proc/registry as the test".  If
>> /proc/registry is found, we skip the file test for the serial device
>> on Cygwin boxes, thereby avoiding the hang.
>>
>> Excerpt (the version that hangs sometimes):
>>
>>
>>   AC_DEFUN([XASTIR_DETECT_DEVICES],
>>   [
>>   AC_MSG_CHECKING([for devices])
>>   if test -c com1 ; then
>>   ac_tnc_port=com1
>>   ac_gps_port=com2
>>   elif test -c /dev/cuaa0 ; then
>>   ac_tnc_port=/dev/cuaa0
>>   ac_gps_port=/dev/cuaa1
>>
>>
>> New improved version:
>>
>>
>>   AC_DEFUN([XASTIR_DETECT_DEVICES],
>>   [
>>   AC_MSG_CHECKING([for devices])
>>   if test -d /proc/registry ; then
>>   ac_tnc_port=/dev/ttyS0
>>   ac_gps_port=/dev/ttyS1
>>   elif test -c /dev/cuaa0 ; then
>>   ac_tnc_port=/dev/cuaa0
>>   ac_gps_port=/dev/cuaa1
>>
>>
>> Should "if test -c com1" or "if test -c /dev/ttyS0" work on Cygwin
>> across all Windows platforms it supports?
>>
>> We'd rather do "if test -c /dev/ttyS0" if possible, so that it's
>> similar across all platforms we support.
>
>I should have completed more of the function above, as it's possible
>that it is one of the other tests that hangs on Cygwin/WinXP.
>Unlikely, but possible.  I expect it hangs on the first test for
>"com1".  Tack the following code onto the end of either code example
>above:
>
>
>  elif test -c /dev/ttyS0 ; then
>  ac_tnc_port=/dev/ttyS0
>  ac_gps_port=/dev/ttyS1
>  elif test -c /dev/cua/a ; then
>  ac_tnc_port=/dev/cua/a
>  ac_gps_port=/dev/cua/b
>  else
>  ac_tnc_port=none
>  ac_gps_port=none
>  fi
>


"com" is a reserved name in Windows.  It's best to steer clear of it in 
any context you can.  You may be catching it in your "if test -c com1"
version.


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

