This is the mail archive of the cygwin-patches@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Files with system bit set.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]