{"thread":{"id":"6398","subject":"Re: [PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.","startedAt":"2007-01-16T03:16:41Z","lastAt":"2007-01-16T03:16:41Z","messageCount":1,"participants":["Jason Riedy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31800","messageId":"18145.1168917401@lotus.CS.Berkeley.EDU","threadId":"6398","inReplyTo":null,"subject":"Re: [PATCH] Solaris 5.8 returns ENOTDIR for inappropriate renames.","fromName":"Jason Riedy","fromEmail":"ejr@cs.berkeley.edu","sentAt":"2007-01-16T03:16:41Z","receivedAt":"2007-01-16T03:16:41Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"And Junio C Hamano writes:\n> > -\t\tif (errno==EISDIR) {\n> > +\t\tif (errno==EISDIR || errno==ENOTDIR) {\n\n> Now \".git/logs/foo/bar\" might already exist as a directory, and\n> this error path is attempting to catch EISDIR that comes out\n> from it (and in that case, if there is nothing but empty\n> directories in the hierarchy under .git/logs/foo/bar, we \n> remove them and retry).\n> \n> Does Solaris give ENOTDIR in such a case?\n\nExactly.  rename(file, directory) produces an error.  Some\nsystems associate the error with the directory and give EISDIR.\nSolaris (at least 5.8) associates the error with the file and\ngives ENOTDIR.\n\nLooks like SUS declares EISDIR as the correct errno.  I didn't\nrealize that...  I don't think it's worth a full compat wrapper\njust for this, but I could be wrong.\n\nIt is worth including your very lucid explanation in the\nroutine's comments, though.\n\nJason\n"}]}