git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jason Riedy <ejr@cs.berkeley.edu>
Date
Jan 16, 2007, 03:16 UTC
Message-ID
<18145.1168917401@lotus.CS.Berkeley.EDU>
And Junio C Hamano writes:
> > -		if (errno==EISDIR) {
> > +		if (errno==EISDIR || errno==ENOTDIR) {
Show 7 quoted lines
> 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
Message 1 of 1 in “Re: [PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.”
  1. Jason RiedyJan 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.