summaryrefslogtreecommitdiff
path: root/lib/e2p/fsetflags.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1998-03-09 13:07:09 +0000
committerTheodore Ts'o <tytso@mit.edu>1998-03-09 13:07:09 +0000
commitcce382b12c2e0764b91d143ec6f9549c735f8f9e (patch)
tree5caf2950bfe8089b228b7576a44c1c771aa7a90f /lib/e2p/fsetflags.c
parentdc3710e5ea6bd83addec20f6956bda707438fa92 (diff)
downloade2fsprogs-cce382b12c2e0764b91d143ec6f9549c735f8f9e.tar.gz
ChangeLog, ls.c:
Mask off high 8 bits from dirent->name_len. Many files: The ext2 version and flags ioctl's take an int *, not a long *. Fix library to use the correct type, so we don't have problems on the Alpha.
Diffstat (limited to 'lib/e2p/fsetflags.c')
-rw-r--r--lib/e2p/fsetflags.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c
index 92e558be..5c760832 100644
--- a/lib/e2p/fsetflags.c
+++ b/lib/e2p/fsetflags.c
@@ -32,31 +32,31 @@
int fsetflags (const char * name, unsigned long flags)
{
#if HAVE_CHFLAGS
- unsigned long bsd_flags = 0;
+ unsigned long bsd_flags = 0;
#ifdef UF_IMMUTABLE
- if (flags & EXT2_IMMUTABLE_FL)
- bsd_flags |= UF_IMMUTABLE;
+ if (flags & EXT2_IMMUTABLE_FL)
+ bsd_flags |= UF_IMMUTABLE;
#endif
#ifdef UF_APPEND
- if (flags & EXT2_APPEND_FL)
- bsd_flags |= UF_APPEND;
+ if (flags & EXT2_APPEND_FL)
+ bsd_flags |= UF_APPEND;
#endif
#ifdef UF_NODUMP
- if (flags & EXT2_NODUMP_FL)
- bsd_flags |= UF_NODUMP;
+ if (flags & EXT2_NODUMP_FL)
+ bsd_flags |= UF_NODUMP;
#endif
- return chflags (name, bsd_flags);
+ return chflags (name, bsd_flags);
#else
#if HAVE_EXT2_IOCTLS
- int fd;
- int r;
+ int fd, r, f;
fd = open (name, O_RDONLY|O_NONBLOCK);
if (fd == -1)
return -1;
- r = ioctl (fd, EXT2_IOC_SETFLAGS, &flags);
+ f = (int) flags;
+ r = ioctl (fd, EXT2_IOC_SETFLAGS, &f);
close (fd);
return r;
#else /* ! HAVE_EXT2_IOCTLS */