summaryrefslogtreecommitdiff
path: root/lib/e2p/fsetflags.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2000-12-02 06:11:44 +0000
committerTheodore Ts'o <tytso@mit.edu>2000-12-02 06:11:44 +0000
commit66d8c3f33f976e83ea0efd361bb5ac182315a421 (patch)
tree18c0da53ec4e8c655b7ab755481fa6df63e7ca31 /lib/e2p/fsetflags.c
parent133a56dc9da52054bc27b4c1a23f03e3405003db (diff)
downloade2fsprogs-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/e2p/fsetflags.c')
-rw-r--r--lib/e2p/fsetflags.c11
1 files changed, 10 insertions, 1 deletions
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;