delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/08/15:39:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Wed, 8 May 2002 15:38:54 -0400 (EDT)
From: Mark Blackburn <marklist AT rivendell DOT fangorn DOT ca>
To: cygwin AT cygwin DOT com
Subject: EISDIR EACCES and open in grep
Message-ID: <Pine.LNX.3.96.1020508152803.24615B-100000@rivendell.fangorn.ca>
MIME-Version: 1.0

I was trying to track down a problem I was having with grep not recursing
subdirectories and this appears to be the problem:
from grep.c in grep-2.5-1:
in the function grepfile (char const *file, struct stats *stats) at
line 911:

      while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
	continue;

      if (desc < 0)
	{
	  int e = errno;

	  if (is_EISDIR (e, file) && directories == RECURSE_DIRECTORIES)
	    {
	      if (stat (file, &stats->stat) != 0)
		{
		  error (0, errno, "%s", file);
		  return 1;
		}

	      return grepdir (file, stats);
	    }

the call to open is leaving a 13 (EACCESS) instead of 21 (EISDIR) in errno
so the call to grepdir doesn't happen.

Platform is Windows 98, cygwin1.dll is version:1.3.10


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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