提交 db823d4a 编写于 作者: L Linus Torvalds

Fix symlink handling

We really always want to have S_IFREG there for non-symlinks,
otherwise we create corrupt index files.
上级 ed4eeaf2
......@@ -89,11 +89,9 @@ struct cache_entry {
#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
static inline unsigned int create_ce_mode(unsigned int mode)
{
if (S_ISREG(mode))
return htonl(S_IFREG | ce_permissions(mode));
if (S_ISLNK(mode))
return htonl(S_IFLNK);
return htonl(mode);
return htonl(S_IFREG | ce_permissions(mode));
}
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册