diff options
author | Theodore Ts'o <tytso@mit.edu> | 2000-12-02 06:11:44 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2000-12-02 06:11:44 +0000 |
commit | 66d8c3f33f976e83ea0efd361bb5ac182315a421 (patch) | |
tree | 18c0da53ec4e8c655b7ab755481fa6df63e7ca31 /lib | |
parent | 133a56dc9da52054bc27b4c1a23f03e3405003db (diff) | |
download | e2fsprogs-66d8c3f33f976e83ea0efd361bb5ac182315a421.tar.gz |
ChangeLog, fgetflags.c, fgetversion.c, fsetflags.c, fsetversion.c:
fgetflags.c (fgetflags):
fgetversion.c (fgetversion):
fsetflags.c (fsetflags):
fsetversion.c (fsetversion): Use the LFS API if available so that the
files are opened with O_LARGEFILE. Addresses Debian bug #72690.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/e2p/ChangeLog | 9 | ||||
-rw-r--r-- | lib/e2p/fgetflags.c | 11 | ||||
-rw-r--r-- | lib/e2p/fgetversion.c | 11 | ||||
-rw-r--r-- | lib/e2p/fsetflags.c | 11 | ||||
-rw-r--r-- | lib/e2p/fsetversion.c | 11 |
5 files changed, 49 insertions, 4 deletions
diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index 816c2ca0..f450c7f3 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,12 @@ +2000-12-02 <tytso@snap.thunk.org> + + * fgetflags.c (fgetflags): + * fgetversion.c (fgetversion): + * fsetflags.c (fsetflags): + * fsetversion.c (fsetversion): Use the LFS API if available so + that the files are opened with O_LARGEFILE. Addresses + Debian bug #72690. + 2000-08-14 <tytso@valinux.com> * ls.c (list_super): Use better description of s_last_orphan diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c index bb3fd2e9..c9b4d1eb 100644 --- a/lib/e2p/fgetflags.c +++ b/lib/e2p/fgetflags.c @@ -14,6 +14,9 @@ * 93/10/30 - Creation */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #if HAVE_ERRNO_H #include <errno.h> #endif @@ -29,6 +32,12 @@ #include "e2p.h" +#ifdef O_LARGEFILE +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK|O_LARGEFILE) +#else +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK) +#endif + int fgetflags (const char * name, unsigned long * flags) { #if HAVE_STAT_FLAGS @@ -56,7 +65,7 @@ int fgetflags (const char * name, unsigned long * flags) #if HAVE_EXT2_IOCTLS int fd, r, f; - fd = open (name, O_RDONLY|O_NONBLOCK); + fd = open (name, OPEN_FLAGS); if (fd == -1) return -1; r = ioctl (fd, EXT2_IOC_GETFLAGS, &f); diff --git a/lib/e2p/fgetversion.c b/lib/e2p/fgetversion.c index 1493eac3..b934c93e 100644 --- a/lib/e2p/fgetversion.c +++ b/lib/e2p/fgetversion.c @@ -14,6 +14,9 @@ * 93/10/30 - Creation */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #if HAVE_ERRNO_H #include <errno.h> #endif @@ -25,12 +28,18 @@ #include "e2p.h" +#ifdef O_LARGEFILE +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK|O_LARGEFILE) +#else +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK) +#endif + int fgetversion (const char * name, unsigned long * version) { #if HAVE_EXT2_IOCTLS int fd, r, ver; - fd = open (name, O_RDONLY|O_NONBLOCK); + fd = open (name, OPEN_FLAGS); if (fd == -1) return - 1; r = ioctl (fd, EXT2_IOC_GETVERSION, &ver); diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c index 5c760832..35266dcd 100644 --- a/lib/e2p/fsetflags.c +++ b/lib/e2p/fsetflags.c @@ -14,6 +14,9 @@ * 93/10/30 - Creation */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #if HAVE_ERRNO_H #include <errno.h> #endif @@ -29,6 +32,12 @@ #include "e2p.h" +#ifdef O_LARGEFILE +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK|O_LARGEFILE) +#else +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK) +#endif + int fsetflags (const char * name, unsigned long flags) { #if HAVE_CHFLAGS @@ -52,7 +61,7 @@ int fsetflags (const char * name, unsigned long flags) #if HAVE_EXT2_IOCTLS int fd, r, f; - fd = open (name, O_RDONLY|O_NONBLOCK); + fd = open (name, OPEN_FLAGS); if (fd == -1) return -1; f = (int) flags; diff --git a/lib/e2p/fsetversion.c b/lib/e2p/fsetversion.c index 428e6e90..597a4bcc 100644 --- a/lib/e2p/fsetversion.c +++ b/lib/e2p/fsetversion.c @@ -14,6 +14,9 @@ * 93/10/30 - Creation */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + #if HAVE_ERRNO_H #include <errno.h> #endif @@ -25,12 +28,18 @@ #include "e2p.h" +#ifdef O_LARGEFILE +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK|O_LARGEFILE) +#else +#define OPEN_FLAGS (O_RDONLY|O_NONBLOCK) +#endif + int fsetversion (const char * name, unsigned long version) { #if HAVE_EXT2_IOCTLS int fd, r, ver; - fd = open (name, O_RDONLY|O_NONBLOCK); + fd = open (name, OPEN_FLAGS); if (fd == -1) return -1; ver = (int) version; |