diff options
Diffstat (limited to 'e2fsprogs/e2fs_lib.c')
-rw-r--r-- | e2fsprogs/e2fs_lib.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/e2fsprogs/e2fs_lib.c b/e2fsprogs/e2fs_lib.c index 48c3b68b5..e40702e78 100644 --- a/e2fsprogs/e2fs_lib.c +++ b/e2fsprogs/e2fs_lib.c | |||
@@ -8,36 +8,6 @@ | |||
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | #include "e2fs_lib.h" | 9 | #include "e2fs_lib.h" |
10 | 10 | ||
11 | #if ENABLE_PLATFORM_MINGW32 | ||
12 | /* Only certain attributes can be set using SetFileAttributes() */ | ||
13 | #define CHATTR_MASK (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | \ | ||
14 | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE | \ | ||
15 | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | \ | ||
16 | FILE_ATTRIBUTE_OFFLINE) | ||
17 | |||
18 | /* Get/set file attributes on a Windows file system */ | ||
19 | int fgetsetflags(const char *name, unsigned *get_flags, unsigned set_flags) | ||
20 | { | ||
21 | struct stat buf; | ||
22 | |||
23 | if (stat(name, &buf) == 0 /* stat is ok */ | ||
24 | && !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode) | ||
25 | ) { | ||
26 | errno = EOPNOTSUPP; | ||
27 | return -1; | ||
28 | } | ||
29 | |||
30 | if (get_flags) { | ||
31 | *get_flags = (unsigned long)buf.st_attr; | ||
32 | } | ||
33 | else if (!SetFileAttributes(name, set_flags & CHATTR_MASK)) { | ||
34 | errno = err_win_to_posix(); | ||
35 | return -1; | ||
36 | } | ||
37 | return 0; | ||
38 | } | ||
39 | #endif | ||
40 | |||
41 | #if !ENABLE_PLATFORM_MINGW32 | 11 | #if !ENABLE_PLATFORM_MINGW32 |
42 | /* Print file attributes on an ext2 file system */ | 12 | /* Print file attributes on an ext2 file system */ |
43 | const uint32_t e2attr_flags_value[] ALIGN4 = { | 13 | const uint32_t e2attr_flags_value[] ALIGN4 = { |