Skip to content

Commit

Permalink
devfs: increment directory sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Oct 5, 2024
1 parent b254d17 commit 08089c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/devfs/src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int createDirectories(const char *name) {
struct stat dirstat;
memset(&dirstat, 0, sizeof(struct stat));
dirstat.st_mode = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
dirstat.st_size = 1;

for(int i = 0; i < depth-1; i++) {
copyPathDepth(dirs, name, i+1);
Expand All @@ -64,6 +65,8 @@ int createDirectories(const char *name) {
} else {
// ensure this is a directory
if((entry->status.st_mode & S_IFMT) != S_IFDIR) return -1;

entry->status.st_size++;
}
}

Expand Down

0 comments on commit 08089c9

Please sign in to comment.