Commit c1802641ff398d11396d6187a3972622b2ff8ba6

Sebastian Schuberth 2011-06-10T13:56:24

Prefer to use file mode defines instead of raw numbers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/index.c b/src/index.c
index 60b6584..08e2490 100644
--- a/src/index.c
+++ b/src/index.c
@@ -142,8 +142,8 @@ unsigned int index_create_mode(unsigned int mode)
 {
 	if (S_ISLNK(mode))
 		return S_IFLNK;
-	if (S_ISDIR(mode) || (mode & S_IFMT) == 0160000)
-		return 0160000;
+	if (S_ISDIR(mode) || (mode & S_IFMT) == (S_IFLNK | S_IFDIR))
+		return (S_IFLNK | S_IFDIR);
 	return S_IFREG | ((mode & 0100) ? 0755 : 0644);
 }