diff options
Diffstat (limited to 'e2fsprogs/ext2fs')
-rw-r--r-- | e2fsprogs/ext2fs/bitops.c | 6 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/bitops.h | 6 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/ext2fs.h | 1 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/ext2fs_inline.c | 8 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/getsectsize.c | 2 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/ismounted.c | 6 |
6 files changed, 15 insertions, 14 deletions
diff --git a/e2fsprogs/ext2fs/bitops.c b/e2fsprogs/ext2fs/bitops.c index e44e10cf4..77ac2a61f 100644 --- a/e2fsprogs/ext2fs/bitops.c +++ b/e2fsprogs/ext2fs/bitops.c @@ -30,7 +30,7 @@ * systems, as well as non-32 bit systems. */ -int ext2fs_set_bit(int nr,void * addr) +int ext2fs_set_bit(unsigned int nr,void * addr) { int mask, retval; unsigned char *ADDR = (unsigned char *) addr; @@ -42,7 +42,7 @@ int ext2fs_set_bit(int nr,void * addr) return retval; } -int ext2fs_clear_bit(int nr, void * addr) +int ext2fs_clear_bit(unsigned int nr, void * addr) { int mask, retval; unsigned char *ADDR = (unsigned char *) addr; @@ -54,7 +54,7 @@ int ext2fs_clear_bit(int nr, void * addr) return retval; } -int ext2fs_test_bit(int nr, const void * addr) +int ext2fs_test_bit(unsigned int nr, const void * addr) { int mask; const unsigned char *ADDR = (const unsigned char *) addr; diff --git a/e2fsprogs/ext2fs/bitops.h b/e2fsprogs/ext2fs/bitops.h index 4dba050c8..5e727d186 100644 --- a/e2fsprogs/ext2fs/bitops.h +++ b/e2fsprogs/ext2fs/bitops.h @@ -15,9 +15,9 @@ #include <strings.h> -extern int ext2fs_set_bit(int nr,void * addr); -extern int ext2fs_clear_bit(int nr, void * addr); -extern int ext2fs_test_bit(int nr, const void * addr); +extern int ext2fs_set_bit(unsigned int nr,void * addr); +extern int ext2fs_clear_bit(unsigned int nr, void * addr); +extern int ext2fs_test_bit(unsigned int nr, const void * addr); extern __u16 ext2fs_swab16(__u16 val); extern __u32 ext2fs_swab32(__u32 val); diff --git a/e2fsprogs/ext2fs/ext2fs.h b/e2fsprogs/ext2fs/ext2fs.h index 7d2a43695..b8752a56e 100644 --- a/e2fsprogs/ext2fs/ext2fs.h +++ b/e2fsprogs/ext2fs/ext2fs.h @@ -330,6 +330,7 @@ typedef struct ext2_struct_inode_scan *ext2_inode_scan; #define EXT2_MF_ISROOT 2 #define EXT2_MF_READONLY 4 #define EXT2_MF_SWAP 8 +#define EXT2_MF_BUSY 16 /* * Ext2/linux mode flags. We define them here so that we don't need diff --git a/e2fsprogs/ext2fs/ext2fs_inline.c b/e2fsprogs/ext2fs/ext2fs_inline.c index 73d393d20..a363b1992 100644 --- a/e2fsprogs/ext2fs/ext2fs_inline.c +++ b/e2fsprogs/ext2fs/ext2fs_inline.c @@ -44,12 +44,14 @@ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size, unsigned long size, void *ptr) { void *p; - void **pp = (void **)ptr; - p = realloc(*pp, size); + /* Use "memcpy" for pointer assignments here to avoid problems + * with C99 strict type aliasing rules. */ + memcpy(&p, ptr, sizeof (p)); + p = realloc(p, size); if (!p) return EXT2_ET_NO_MEMORY; - *pp = p; + memcpy(ptr, &p, sizeof (p)); return 0; } diff --git a/e2fsprogs/ext2fs/getsectsize.c b/e2fsprogs/ext2fs/getsectsize.c index b561660ba..36871f236 100644 --- a/e2fsprogs/ext2fs/getsectsize.c +++ b/e2fsprogs/ext2fs/getsectsize.c @@ -23,7 +23,7 @@ #include <linux/fd.h> #endif -#if defined(__linux__) && defined(_IO) && !defined(BLKGETSIZE) +#if defined(__linux__) && defined(_IO) && !defined(BLKSSZGET) #define BLKSSZGET _IO(0x12,104)/* get block device sector size */ #endif diff --git a/e2fsprogs/ext2fs/ismounted.c b/e2fsprogs/ext2fs/ismounted.c index 2395ccaed..125fe244b 100644 --- a/e2fsprogs/ext2fs/ismounted.c +++ b/e2fsprogs/ext2fs/ismounted.c @@ -339,20 +339,18 @@ int main(int argc, char **argv) exit(1); } printf("Device %s reports flags %02x\n", argv[1], mount_flags); + if (mount_flags & EXT2_MF_BUSY) + printf("\t%s is apparently in use.\n", argv[1]); if (mount_flags & EXT2_MF_MOUNTED) printf("\t%s is mounted.\n", argv[1]); - if (mount_flags & EXT2_MF_SWAP) printf("\t%s is a swap device.\n", argv[1]); - if (mount_flags & EXT2_MF_READONLY) printf("\t%s is read-only.\n", argv[1]); - if (mount_flags & EXT2_MF_ISROOT) printf("\t%s is the root filesystem.\n", argv[1]); if (mntpt[0]) printf("\t%s is mounted on %s.\n", argv[1], mntpt); - exit(0); } #endif /* DEBUG */ |