delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/06/19:00:45

X-Spam-Check-By: sourceware.org
Date: Tue, 6 Dec 2005 16:00:50 -0800
From: Yitzchak Scott-Thoennes <sthoenna AT efn DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: cygcheck bug when listing services (Was Re: Parallel writes to a single FIFO do not queue, and deadlock cygwin)
Message-ID: <20051207000050.GB5452@efn.org>
References: <5a97ceb0512042223i404ebffeuff5546e2345df965 AT mail DOT gmail DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0512050924150 DOT 13495 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.63.0512050924150.13495@slinky.cs.nyu.edu>
User-Agent: Mutt/1.4.2.1i
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, Dec 05, 2005 at 09:40:01AM -0500, Igor Pechtchanski wrote:
> Running cygcheck under strace shows that after listing all the available
> services, it invokes "cygrunsrv --query grunsrv.exe --list", which results
> in the above message.  I think this may be because the output of
> "cygrunsrv --list" doesn't contain a trailing '\n', and so strtok gets
> confused.  The following patch (against a slightly older cygcheck) fixes
> it for me, but I haven't had the time to test it extensively:
> 
> Index: cygcheck.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/utils/cygcheck.cc,v
> retrieving revision 1.77
> diff -u -p -r1.77 cygcheck.cc
> --- cygcheck.cc 17 Aug 2005 00:52:43 -0000      1.77
> +++ cygcheck.cc 5 Dec 2005 14:37:58 -0000
> @@ -950,8 +950,8 @@ dump_sysinfo_services ()
>    else
>      {
>        /* read the output of --list, and then run --query for each service */
> -      size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 1, f);
> -      buf[nchars] = 0;
> +      size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 2, f);
> +      buf[nchars] = buf[nchars+1] = 0;

That needs a comment in the code.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019