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:
Theodore Ts'o 2008-01-21 09:45:25 -05:00 committed by Ted Tso
parent f8897f4efe
commit 153439222e
2 changed files with 7 additions and 2 deletions

View File

@ -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
/*

View File

@ -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) {