diff options
author | Andreas Dilger <adilger@whamcloud.com> | 2011-09-24 12:59:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-24 13:00:24 -0400 |
commit | 6b56f3d92d08806ab415e8fd883480f7f9c148e8 (patch) | |
tree | aab94e809cda4d95c1bc81712dd1a8859d65b942 /lib/ext2fs | |
parent | 9d9a53e651fa877eb4f9df0bfd97fbcc5f514293 (diff) | |
download | e2fsprogs-6b56f3d92d08806ab415e8fd883480f7f9c148e8.tar.gz |
misc: quiet minor compiler errors
Several compiler errors are quieted:
- zero-length gnu_printf format string
- unused variable
- uninitalized variable (though it isn't actually used for anything)
- fixed a bug in ext2fs_stat() if stat64() does not exist
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r-- | lib/ext2fs/crc32c.c | 1 | ||||
-rw-r--r-- | lib/ext2fs/ext2fs.h | 18 | ||||
-rw-r--r-- | lib/ext2fs/getsize.c | 10 |
3 files changed, 17 insertions, 12 deletions
diff --git a/lib/ext2fs/crc32c.c b/lib/ext2fs/crc32c.c index c9b610bf..65bca5c3 100644 --- a/lib/ext2fs/crc32c.c +++ b/lib/ext2fs/crc32c.c @@ -30,7 +30,6 @@ */ #include "config.h" #include <stdint.h> -#include <endian.h> #include <stdlib.h> #include <stdio.h> #define __force diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index c3237dbf..b91eef8f 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -586,7 +586,7 @@ typedef struct ext2_icount *ext2_icount_t; #define EXT2FS_NUM_B2C(fs, blks) (((blks) + EXT2FS_CLUSTER_MASK(fs)) >> \ (fs)->cluster_ratio_bits) -#ifdef HAVE_OPEN64 +#if defined(HAVE_STAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) typedef struct stat64 ext2fs_struct_stat; #else typedef struct stat ext2fs_struct_stat; @@ -1411,6 +1411,7 @@ extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); extern __u64 ext2fs_div64_ceil(__u64 a, __u64 b); extern int ext2fs_open_file(const char *pathname, int flags, ...); extern int ext2fs_stat(const char *path, ext2fs_struct_stat *buf); +extern int ext2fs_fstat(int fd, ext2fs_struct_stat *buf); /* * The actual inlined functions definitions themselves... @@ -1671,7 +1672,7 @@ _INLINE_ int ext2fs_open_file(const char *pathname, int flags, ...) va_end(args); if (mode) -#ifdef HAVE_OPEN64 +#if defined(HAVE_OPEN64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) return open64(pathname, flags, mode); else return open64(pathname, flags); @@ -1684,10 +1685,19 @@ _INLINE_ int ext2fs_open_file(const char *pathname, int flags, ...) _INLINE_ int ext2fs_stat(const char *path, ext2fs_struct_stat *buf) { -#ifdef HAVE_OPEN64 +#if defined(HAVE_STAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) return stat64(path, buf); #else - return open(path, buf); + return stat(path, buf); +#endif +} + +_INLINE_ int ext2fs_fstat(int fd, ext2fs_struct_stat *buf) +{ +#if defined(HAVE_STAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) + return fstat64(fd, buf); +#else + return fstat(fd, buf); #endif } diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c index 690349c5..a2e6e472 100644 --- a/lib/ext2fs/getsize.c +++ b/lib/ext2fs/getsize.c @@ -232,13 +232,9 @@ errcode_t ext2fs_get_device_size2(const char *file, int blocksize, #endif /* HAVE_SYS_DISKLABEL_H */ { -#if defined(HAVE_FSTAT64) && !defined(__OSX__) - struct stat64 st; - if (fstat64(fd, &st) == 0) -#else - struct stat st; - if (fstat(fd, &st) == 0) -#endif + ext2fs_struct_stat st; + + if (ext2fs_fstat(fd, &st) == 0) if (S_ISREG(st.st_mode)) { *retblocks = st.st_size / blocksize; goto out; |