diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-06-11 00:49:29 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-06-11 00:49:29 +0000 |
commit | 349a484a57ab13fed315f72552bdf8dbf89ba72a (patch) | |
tree | dca1a91ffcc8934a7152beff2bc0ed730aeefb29 | |
parent | c05b552185d7d59f23edf12be5a83596724432c9 (diff) | |
download | e2fsprogs-349a484a57ab13fed315f72552bdf8dbf89ba72a.tar.gz |
ChangeLog, Makefile.in, mkjournal.c:
Makefile.in: Remove the dependence on the libe2p library.
mkjournal.c (ext2fs_add_journal_inode): Replace use of fsetflags with
direct usage of the ioctl/fchflags so that we don't have to depend on
the libe2p library.
-rw-r--r-- | lib/ext2fs/ChangeLog | 8 | ||||
-rw-r--r-- | lib/ext2fs/Makefile.in | 4 | ||||
-rw-r--r-- | lib/ext2fs/mkjournal.c | 20 |
3 files changed, 25 insertions, 7 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 72327373..4ff3df46 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,11 @@ +2001-06-10 Theodore Tso <tytso@valinux.com> + + * Makefile.in: Remove the dependence on the libe2p library. + + * mkjournal.c (ext2fs_add_journal_inode): Replace use of fsetflags + with direct usage of the ioctl/fchflags so that we don't + have to depend on the libe2p library. + 2001-06-08 Theodore Tso <tytso@valinux.com> * ext2_types.h.in: Use unsigned ints in favor of unsigned longs diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in index 3a69a836..6278b8d2 100644 --- a/lib/ext2fs/Makefile.in +++ b/lib/ext2fs/Makefile.in @@ -122,7 +122,7 @@ DLL_GOTSIZE = 0x1000 DLL_VERSION = 1.2 DLL_IMAGE = libe2fs DLL_STUB = libext2fs -DLL_LIBS = -L../.. -lcom_err -le2p +DLL_LIBS = -L../.. -lcom_err DLL_MYDIR = ext2fs DLL_INSTALL_DIR = $(root_libdir) @@ -131,7 +131,7 @@ ELF_SO_VERSION = 2 ELF_IMAGE = libext2fs ELF_MYDIR = ext2fs ELF_INSTALL_DIR = $(root_libdir) -ELF_OTHER_LIBS = -L../.. -lcom_err -le2p +ELF_OTHER_LIBS = -L../.. -lcom_err BSDLIB_VERSION = 2.1 BSDLIB_IMAGE = libext2fs diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index bf5ca679..092e4a24 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -25,6 +25,9 @@ #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +#if HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif #if HAVE_NETINET_IN_H #include <netinet/in.h> #endif @@ -306,7 +309,7 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags) ext2_ino_t journal_ino; struct stat st; char jfile[1024]; - int fd, mount_flags; + int fd, mount_flags, f; if ((retval = ext2fs_check_mount_point(fs->device_name, &mount_flags, jfile, sizeof(jfile)-10))) @@ -324,13 +327,20 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags) return retval; /* Get inode number of the journal file */ - if (stat(jfile, &st) < 0) + if (fstat(fd, &st) < 0) return errno; - if ((retval = fsetflags(jfile, - EXT2_NODUMP_FL | EXT2_IMMUTABLE_FL))) +#if HAVE_CHFLAGS + retval = fchflags (fd, UF_NODUMP|UF_IMMUTABLE); +#else +#if HAVE_EXT2_IOCTLS + f = EXT2_NODUMP_FL | EXT2_IMMUTABLE_FL;; + retval = ioctl(fd, EXT2_IOC_SETFLAGS, &f); +#endif +#endif + if (retval) return retval; - + journal_ino = st.st_ino; } else { journal_ino = EXT2_JOURNAL_INO; |