Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <39168E39.E3A4494D@vinschen.de> Date: Mon, 08 May 2000 11:51:53 +0200 From: Corinna Vinschen Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com Organization: Cygnus Solutions, a Red Hat Company X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: "Fifer, Eric" CC: cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: stat() behavior differs on Win9x and WinNT References: <779F20BCCE5AD31186A50008C75D997917171E AT silldn_mail1 DOT sanwaint DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Fifer, Eric" wrote: > > With recent snapshots, stat() of a file with an invalid name, > like stat("abc>def") ('>' is not allowed in file names), does > not fail on Win98: > [...] > Win98: > symlink_info::check: GetFileAttributesA (c:\efifer\opt\abc>def) failed > seterrno: 161 (BAD_PATHNAME) -> 22 > [...] > > WinNT: > symlink_info::check: GetFileAttributesA (c:\efifer\opt\abc>def) failed > seterrno: 123 (INVALID_NAME) -> 2 > > A patch is trival, but I'm not sure which is correct: > > + map BAD_PATHNAME to ENOENT (instead of the current EINVAL), but > I have no idea how widespread the impact of this might be. Or, > maybe INVALID_NAME should really be EINVAL? > > + change the test in stat_worker to: > > (!oret && get_errno () != ENOENT && get_errno () != EINVAL) IMO the mapping ERROR_BAD_PATHNAME -> EINVAL is incorrect. Corinna