mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-28 04:23:45 +08:00
Define helper functions ext2fs_set_i_{u,g}id_high() for MacOS compatibility
This is needed for all non-Linux/Hurd/Masix systems... Addresses-Sourceforge-Bug: #1863819 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
f8897f4efe
commit
153439222e
@ -452,9 +452,14 @@ struct ext2_inode_large {
|
||||
#if defined(__masix__)
|
||||
#define inode_uid(inode) ((inode).i_uid)
|
||||
#define inode_gid(inode) ((inode).i_gid)
|
||||
#define ext2fs_set_i_uid_high(inode,x) (x)
|
||||
#define ext2fs_set_i_gid_high(inode,x) (x)
|
||||
|
||||
#else
|
||||
#define inode_uid(inode) ((inode).i_uid | (inode).osd2.linux2.l_i_uid_high << 16)
|
||||
#define inode_gid(inode) ((inode).i_gid | (inode).osd2.linux2.l_i_gid_high << 16)
|
||||
#define ext2fs_set_i_uid_high(inode,x) ((inode).osd2.linux2.l_i_uid_high = (x))
|
||||
#define ext2fs_set_i_gid_high(inode,x) ((inode).osd2.linux2.l_i_gid_high = (x))
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -495,11 +495,11 @@ static void create_root_dir(ext2_filsys fs)
|
||||
}
|
||||
uid = getuid();
|
||||
inode.i_uid = uid;
|
||||
inode.i_uid_high = uid >> 16;
|
||||
ext2fs_set_i_uid_high(inode, uid >> 16);
|
||||
if (uid) {
|
||||
gid = getgid();
|
||||
inode.i_gid = gid;
|
||||
inode.i_gid_high = gid >> 16;
|
||||
ext2fs_set_i_gid_high(inode, gid >> 16);
|
||||
}
|
||||
retval = ext2fs_write_new_inode(fs, EXT2_ROOT_INO, &inode);
|
||||
if (retval) {
|
||||
|
Loading…
Reference in New Issue
Block a user