fi
+for ac_hdr in inttypes.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5806: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5811 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for intptr_t""... $ac_c" 1>&6
+echo "configure:5843: checking for intptr_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_intptr_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5848 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])intptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_intptr_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_intptr_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_intptr_t" 1>&6
+if test $ac_cv_type_intptr_t = no; then
+ cat >> confdefs.h <<\EOF
+#define intptr_t long
+EOF
+
+fi
+
echo $ac_n "checking whether struct stat has a st_flags field""... $ac_c" 1>&6
-echo "configure:5803: checking whether struct stat has a st_flags field" >&5
+echo "configure:5876: checking whether struct stat has a st_flags field" >&5
if eval "test \"`echo '$''{'e2fsprogs_cv_struct_st_flags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5808 "configure"
+#line 5881 "configure"
#include "confdefs.h"
#include <sys/stat.h>
int main() {
struct stat stat; stat.st_flags = 0;
; return 0; }
EOF
-if { (eval echo configure:5815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
e2fsprogs_cv_struct_st_flags=yes
else
echo "$ac_t""$e2fsprogs_cv_struct_st_flags" 1>&6
if test "$e2fsprogs_cv_struct_st_flags" = yes; then
echo $ac_n "checking whether st_flags field is useful""... $ac_c" 1>&6
-echo "configure:5830: checking whether st_flags field is useful" >&5
+echo "configure:5903: checking whether st_flags field is useful" >&5
if eval "test \"`echo '$''{'e2fsprogs_cv_struct_st_flags_immut'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5835 "configure"
+#line 5908 "configure"
#include "confdefs.h"
#include <sys/stat.h>
int main() {
struct stat stat; stat.st_flags |= UF_IMMUTABLE;
; return 0; }
EOF
-if { (eval echo configure:5842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
e2fsprogs_cv_struct_st_flags_immut=yes
else
for ac_func in chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5865: checking for $ac_func" >&5
+echo "configure:5938: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5870 "configure"
+#line 5943 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
SOCKET_LIB=''
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:5919: checking for socket in -lsocket" >&5
+echo "configure:5992: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5927 "configure"
+#line 6000 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
socket()
; return 0; }
EOF
-if { (eval echo configure:5938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
DLOPEN_LIB=''
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5961: checking for dlopen in -ldl" >&5
+echo "configure:6034: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5969 "configure"
+#line 6042 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dlopen()
; return 0; }
EOF
-if { (eval echo configure:5980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for optreset""... $ac_c" 1>&6
-echo "configure:6006: checking for optreset" >&5
+echo "configure:6079: checking for optreset" >&5
if eval "test \"`echo '$''{'ac_cv_have_optreset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6011 "configure"
+#line 6084 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
echo $ac_n "checking whether linker accepts -static""... $ac_c" 1>&6
-echo "configure:6102: checking whether linker accepts -static" >&5
+echo "configure:6175: checking whether linker accepts -static" >&5
if eval "test \"`echo '$''{'ac_cv_e2fsprogs_use_static'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
cat > conftest.$ac_ext <<EOF
-#line 6108 "configure"
+#line 6181 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
fflush(stdout);
; return 0; }
EOF
-if { (eval echo configure:6115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_e2fsprogs_use_static=yes
else
#include <errno.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+/* Needed for architectures where sizeof(int) != sizeof(void *) */
+#define INT_TO_VOIDPTR(val) ((void *)(intptr_t)(val))
+#define VOIDPTR_TO_INT(ptr) ((int)(intptr_t)(ptr))
+
#include <et/com_err.h>
#include "e2fsck.h"
static int dict_int_cmp(const void *a, const void *b)
{
- int ia, ib;
+ intptr_t ia, ib;
- ia = (int) a;
- ib = (int) b;
+ ia = (intptr_t)a;
+ ib = (intptr_t)b;
return (ia-ib);
}
struct block_el *blk_el;
struct inode_el *ino_el;
- n = dict_lookup(&blk_dict, (void *) blk);
+ n = dict_lookup(&blk_dict, INT_TO_VOIDPTR(blk));
if (n)
db = (struct dup_block *) dnode_get(n);
else {
sizeof(struct dup_block), "duplicate block header");
db->num_bad = 0;
db->inode_list = 0;
- dict_alloc_insert(&blk_dict, (void *) blk, db);
+ dict_alloc_insert(&blk_dict, INT_TO_VOIDPTR(blk), db);
}
ino_el = (struct inode_el *) e2fsck_allocate_memory(ctx,
sizeof(struct inode_el), "inode element");
db->inode_list = ino_el;
db->num_bad++;
- n = dict_lookup(&ino_dict, (void *) ino);
+ n = dict_lookup(&ino_dict, INT_TO_VOIDPTR(ino));
if (n)
di = (struct dup_inode *) dnode_get(n);
else {
di->num_dupblocks = 0;
di->block_list = 0;
di->inode = *inode;
- dict_alloc_insert(&ino_dict, (void *) ino, di);
+ dict_alloc_insert(&ino_dict, INT_TO_VOIDPTR(ino), di);
}
blk_el = (struct block_el *) e2fsck_allocate_memory(ctx,
sizeof(struct block_el), "block element");
!ext2fs_test_inode_bitmap(inode_dup_map, dirent->inode))
return 0;
- n = dict_lookup(&ino_dict, (void *) dirent->inode);
+ n = dict_lookup(&ino_dict, INT_TO_VOIDPTR(dirent->inode));
if (!n)
return 0;
p = (struct dup_inode *) dnode_get(n);
p = (struct dup_inode *) dnode_get(n);
shared_len = 0;
file_ok = 1;
- ino = (ext2_ino_t) dnode_getkey(n);
+ ino = (ext2_ino_t)VOIDPTR_TO_INT(dnode_getkey(n));
if (ino == EXT2_BAD_INO)
continue;
* get the list of inodes, and merge them together.
*/
for (s = p->block_list; s; s = s->next) {
- m = dict_lookup(&blk_dict, (void *) s->block);
+ m = dict_lookup(&blk_dict, INT_TO_VOIDPTR(s->block));
if (!m)
continue; /* Should never happen... */
q = (struct dup_block *) dnode_get(m);
fix_problem(ctx, PR_1D_SHARE_METADATA, &pctx);
for (i = 0; i < shared_len; i++) {
- m = dict_lookup(&ino_dict, (void *) shared[i]);
+ m = dict_lookup(&ino_dict, INT_TO_VOIDPTR(shared[i]));
if (!m)
continue; /* should never happen */
t = (struct dup_inode *) dnode_get(m);
return 0;
if (ext2fs_test_block_bitmap(ctx->block_dup_map, *block_nr)) {
- n = dict_lookup(&blk_dict, (void *) *block_nr);
+ n = dict_lookup(&blk_dict, INT_TO_VOIDPTR(*block_nr));
if (n) {
p = (struct dup_block *) dnode_get(n);
decrement_badcount(ctx, *block_nr, p);
return 0;
if (ext2fs_test_block_bitmap(ctx->block_dup_map, *block_nr)) {
- n = dict_lookup(&blk_dict, (void *) *block_nr);
+ n = dict_lookup(&blk_dict, INT_TO_VOIDPTR(*block_nr));
if (n) {
p = (struct dup_block *) dnode_get(n);
retval = ext2fs_new_block(fs, 0, ctx->block_found_map,
* which refered to that EA block, and modify
* them to point to the new EA block.
*/
- n = dict_lookup(&blk_dict, (void *) blk);
+ n = dict_lookup(&blk_dict, INT_TO_VOIDPTR(blk));
db = (struct dup_block *) dnode_get(n);
for (ino_el = db->inode_list; ino_el; ino_el = ino_el->next) {
if (ino_el->inode == ino)
continue;
- n = dict_lookup(&ino_dict, (void *) ino_el->inode);
+ n = dict_lookup(&ino_dict, INT_TO_VOIDPTR(ino_el->inode));
di = (struct dup_inode *) dnode_get(n);
if (di->inode.i_file_acl == blk) {
di->inode.i_file_acl = dp->inode.i_file_acl;