libroot_build: Use a union for dirent structures.
Same fixe as applied to the rest of the Storage Kit a few commits ago.
This commit is contained in:
@@ -130,8 +130,9 @@ typedef map<DIR*, AttributeDirectory*> AttrDirMap;
|
|||||||
static AttrDirMap sAttributeDirectories;
|
static AttrDirMap sAttributeDirectories;
|
||||||
|
|
||||||
// LongDirent
|
// LongDirent
|
||||||
struct LongDirent : dirent {
|
union LongDirent {
|
||||||
char name[B_FILE_NAME_LENGTH];
|
struct dirent dirent;
|
||||||
|
char _[sizeof(struct dirent) + B_FILE_NAME_LENGTH];
|
||||||
};
|
};
|
||||||
|
|
||||||
// AttributeHeader
|
// AttributeHeader
|
||||||
@@ -259,11 +260,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prepare the dirent
|
// prepare the dirent
|
||||||
strcpy(fDirent.d_name, name);
|
strcpy(fDirent.dirent.d_name, name);
|
||||||
fDirent.d_ino = 0;
|
fDirent.dirent.d_ino = 0;
|
||||||
// TODO: We need the node ID!
|
// TODO: We need the node ID!
|
||||||
|
|
||||||
*_entry = &fDirent;
|
*_entry = &fDirent.dirent;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user