1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

Ext2FS: Make reported file_type values match up with those in dirent

This fixes an issue we had in the git port where git would not
recognize untracked files (for example in 'git status').
When git used readdir, the 'd_type' field in the dirent struct contained
bad values (Specifically, it contained the values defiend in
Kernel/FileSystem/ext2_fs.h instead of the ones in LibC/dirent.h).

After this fix, we can create a new git repository with 'git init', and
then stage and commit files as usual.
This commit is contained in:
Itamar 2020-08-28 16:15:51 +03:00 committed by Andreas Kling
parent 6cf064e4c6
commit b6c34c0521
3 changed files with 47 additions and 1 deletions

View file

@ -614,3 +614,25 @@ struct rtentry {
#define PT_PEEK 7
#define PT_POKE 8
#define PT_SETREGS 9
// Used in struct dirent
enum {
DT_UNKNOWN = 0,
#define DT_UNKNOWN DT_UNKNOWN
DT_FIFO = 1,
#define DT_FIFO DT_FIFO
DT_CHR = 2,
#define DT_CHR DT_CHR
DT_DIR = 4,
#define DT_DIR DT_DIR
DT_BLK = 6,
#define DT_BLK DT_BLK
DT_REG = 8,
#define DT_REG DT_REG
DT_LNK = 10,
#define DT_LNK DT_LNK
DT_SOCK = 12,
#define DT_SOCK DT_SOCK
DT_WHT = 14
#define DT_WHT DT_WHT
};