From 36cb9bac61d74bec7808cf036b2bab298d971f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 24 May 2005 10:38:59 +0000 Subject: [PATCH] Attribute directories must have the S_IFDIR flag set, attribute files the S_IFREG flag. The missing flags caused the original BFS to crash on our files. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12796 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 6 ++++-- src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index 50762ad037..aa4a951216 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -990,7 +990,8 @@ Inode::CreateAttribute(Transaction &transaction, const char *name, uint32 type, { // do we need to create the attribute directory first? if (Attributes().IsZero()) { - status_t status = Inode::Create(transaction, this, NULL, S_ATTR_DIR | 0666, 0, 0, NULL); + status_t status = Inode::Create(transaction, this, NULL, + S_ATTR_DIR | S_DIRECTORY | 0666, 0, 0, NULL); if (status < B_OK) RETURN_ERROR(status); } @@ -1000,7 +1001,8 @@ Inode::CreateAttribute(Transaction &transaction, const char *name, uint32 type, return B_ERROR; // Inode::Create() locks the inode for us - return Inode::Create(transaction, attributes, name, S_ATTR | 0666, 0, type, NULL, attribute); + return Inode::Create(transaction, attributes, name, + S_ATTR | S_REGULAR | 0666, 0, type, NULL, attribute); } diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp index 0b0ff0cafa..ebcc8c2b36 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp @@ -953,7 +953,8 @@ Inode::CreateAttribute(Transaction *transaction, const char *name, uint32 type, { // do we need to create the attribute directory first? if (Attributes().IsZero()) { - status_t status = Inode::Create(transaction, this, NULL, S_ATTR_DIR | 0666, 0, 0, NULL); + status_t status = Inode::Create(transaction, this, NULL, + S_ATTR_DIR | S_DIRECTORY | 0666, 0, 0, NULL); if (status < B_OK) RETURN_ERROR(status); } @@ -963,7 +964,8 @@ Inode::CreateAttribute(Transaction *transaction, const char *name, uint32 type, return B_ERROR; // Inode::Create() locks the inode for us - return Inode::Create(transaction, attributes, name, S_ATTR | 0666, 0, type, NULL, attribute); + return Inode::Create(transaction, attributes, name, + S_ATTR | S_REGULAR | 0666, 0, type, NULL, attribute); }