Merge branch 'master' of github.com:wombatant/ox
This commit is contained in:
@@ -43,6 +43,11 @@ struct DirectoryListing {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename String>
|
||||||
|
bool operator<(const DirectoryListing<String> &a, const DirectoryListing<String> &b) {
|
||||||
|
return a.name < b.name;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename InodeId_t>
|
template<typename InodeId_t>
|
||||||
struct __attribute__((packed)) DirectoryEntry {
|
struct __attribute__((packed)) DirectoryEntry {
|
||||||
InodeId_t inode;
|
InodeId_t inode;
|
||||||
@@ -380,6 +385,7 @@ int FileSystemTemplate<FileStore, FS_TYPE>::stripDirectories() {
|
|||||||
|
|
||||||
template<typename FileStore, FsType FS_TYPE>
|
template<typename FileStore, FsType FS_TYPE>
|
||||||
int FileSystemTemplate<FileStore, FS_TYPE>::mkdir(const char *path) {
|
int FileSystemTemplate<FileStore, FS_TYPE>::mkdir(const char *path) {
|
||||||
|
if (!stat(path).inode) {
|
||||||
Directory<typename FileStore::InodeId_t, typename FileStore::FsSize_t> dir;
|
Directory<typename FileStore::InodeId_t, typename FileStore::FsSize_t> dir;
|
||||||
auto err = write(path, &dir, sizeof(dir), FileType::FileType_Directory);
|
auto err = write(path, &dir, sizeof(dir), FileType::FileType_Directory);
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -406,6 +412,9 @@ int FileSystemTemplate<FileStore, FS_TYPE>::mkdir(const char *path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FileStore, FsType FS_TYPE>
|
template<typename FileStore, FsType FS_TYPE>
|
||||||
|
|||||||
Reference in New Issue
Block a user