This is the mail archive of the
cygwin-patches@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Files with system bit set.
- To: cygpatch <cygwin-patches at sourceware dot cygnus dot com>
- Subject: Re: Files with system bit set.
- From: Corinna Vinschen <corinna at vinschen dot de>
- Date: Mon, 08 May 2000 23:27:47 +0200
- Organization: Cygnus Solutions, a Red Hat Company
- References: <3917298E.821F9CE5@vinschen.de> <20000508171856.A1920@cygnus.com>
- Reply-To: cygpatch <cygwin-patches at sourceware dot cygnus dot com>
Chris Faylor wrote:
>
> Doesn't this always set errno to EINVAL? How is that better?
It's better because it's the expected behaviour for ordinary
files. Excerpt from path_conv::check():
int len = sym.check (path_copy, suff);
if (!component)
path_flags = sym.pflags;
/* If symlink.check found an existing non-symlink file, then
it returns a length of 0 and sets errno to EINVAL. It also sets
any suffix found into `ext_here'. */
if (!sym.is_symlink && sym.fileattr != (DWORD) -1)
{
if (component == 0)
{
fileattr = sym.fileattr;
goto fillin;
}
goto out; // file found
}
Corinna