Thread (13 messages) flat view 13 messages, 4 authors, 2016-06-15

Re: [PATCH] Do _not_ call unlink on a directory

From: Scott Lamb <hidden>
Date: 2016-06-15 22:43:21

Linus Torvalds wrote:
No, but we don't *want* the "rmdir for directories" part! 

That's the whole point.

Calling "remove()" would be *wrong*. We want the *sane* "unlink()" 
behaviour, where it only removes files, and returns an error for 
directories.
Of course, but when used immediately after stat() says the path does not
refer to a directory, I would prefer SUS remove() (rmdir() for
directories) to Solaris unlink() (break_filesystem() on directories).

But Solaris remove() is broken, too, so it's a moot point. The
post-patch behavior is good enough - as you said, it won't happen during
reasonable usage and the problem's not unique to git.

Best regards,
Scott

-- 
Scott Lamb <http://www.slamb.org/>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help