Re: [PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



And Junio C Hamano writes:
> > -		if (errno==EISDIR) {
> > +		if (errno==EISDIR || errno==ENOTDIR) {

> Now ".git/logs/foo/bar" might already exist as a directory, and
> this error path is attempting to catch EISDIR that comes out
> from it (and in that case, if there is nothing but empty
> directories in the hierarchy under .git/logs/foo/bar, we 
> remove them and retry).
> 
> Does Solaris give ENOTDIR in such a case?

Exactly.  rename(file, directory) produces an error.  Some
systems associate the error with the directory and give EISDIR.
Solaris (at least 5.8) associates the error with the file and
gives ENOTDIR.

Looks like SUS declares EISDIR as the correct errno.  I didn't
realize that...  I don't think it's worth a full compat wrapper
just for this, but I could be wrong.

It is worth including your very lucid explanation in the
routine's comments, though.

Jason
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]