aboutsummaryrefslogtreecommitdiffstats
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-09-12 09:10:39 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-09-12 09:10:39 -0400
commit0eeec8ac61bf1eaa31533b2be825cd75580829c9 (patch)
tree89118cba85bf3cd64ba24e2c205788baead4d607 /e2fsck
parentf8bd55160cde8a678a9ddbf69b7555504b253bef (diff)
downloadandroid_external_e2fsprogs-0eeec8ac61bf1eaa31533b2be825cd75580829c9.tar.gz
android_external_e2fsprogs-0eeec8ac61bf1eaa31533b2be825cd75580829c9.tar.bz2
android_external_e2fsprogs-0eeec8ac61bf1eaa31533b2be825cd75580829c9.zip
Fix compiling under diet libc
Some recent changes had caused diet libc support to bitrot. Fix up missing header files and other portability fixups needed for dietlibc. (Many of these changes also improve general portability.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/Makefile.in2
-rw-r--r--e2fsck/crc32.c3
-rw-r--r--e2fsck/ea_refcount.c3
-rw-r--r--e2fsck/message.c8
-rw-r--r--e2fsck/pass1.c2
-rw-r--r--e2fsck/region.c3
6 files changed, 17 insertions, 4 deletions
diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
index fe0fab52..77300d18 100644
--- a/e2fsck/Makefile.in
+++ b/e2fsck/Makefile.in
@@ -141,7 +141,7 @@ tst_crc32: $(srcdir)/crc32.c $(LIBEXT2FS)
tst_refcount: ea_refcount.c
@echo " LD $@"
@$(CC) -o tst_refcount $(srcdir)/ea_refcount.c \
- $(ALL_CFLAGS) -DTEST_PROGRAM $(LIBCOM_ERR)
+ $(ALL_CFLAGS) -DTEST_PROGRAM $(LIBCOM_ERR) $(LIBEXT2FS)
tst_region: region.c
@echo " LD $@"
diff --git a/e2fsck/crc32.c b/e2fsck/crc32.c
index f46295e1..f092c03a 100644
--- a/e2fsck/crc32.c
+++ b/e2fsck/crc32.c
@@ -36,6 +36,9 @@
#include <string.h>
#include <ctype.h>
+#ifdef UNITTEST
+#undef ENABLE_NLS
+#endif
#include "e2fsck.h"
#include "crc32defs.h"
diff --git a/e2fsck/ea_refcount.c b/e2fsck/ea_refcount.c
index daaedc4b..39f2db7f 100644
--- a/e2fsck/ea_refcount.c
+++ b/e2fsck/ea_refcount.c
@@ -11,6 +11,9 @@
#include <string.h>
#include <stdio.h>
+#ifdef TEST_PROGRAM
+#undef ENABLE_NLS
+#endif
#include "e2fsck.h"
/*
diff --git a/e2fsck/message.c b/e2fsck/message.c
index f79b73c4..5158ed64 100644
--- a/e2fsck/message.c
+++ b/e2fsck/message.c
@@ -246,7 +246,7 @@ static _INLINE_ void expand_inode_expression(char ch,
struct ext2_inode_large *large_inode;
const char * time_str;
time_t t;
- int do_gmt = -1;
+ static int do_gmt = -1;
if (!ctx || !ctx->inode)
goto no_inode;
@@ -289,15 +289,17 @@ static _INLINE_ void expand_inode_expression(char ch,
printf("0%o", inode->i_mode);
break;
case 'M':
+#ifdef __dietlibc__
/* The diet libc doesn't respect the TZ environemnt variable */
if (do_gmt == -1) {
time_str = getenv("TZ");
if (!time_str)
time_str = "";
- do_gmt = !strcmp(time_str, "GMT");
+ do_gmt = !strcmp(time_str, "GMT0");
}
+#endif
t = inode->i_mtime;
- time_str = asctime(do_gmt ? gmtime(&t) : localtime(&t));
+ time_str = asctime((do_gmt > 0) ? gmtime(&t) : localtime(&t));
printf("%.24s", time_str);
break;
case 'F':
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 8bbf7feb..8ad08715 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -1206,6 +1206,8 @@ static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b)
ib_b->inode.i_block[EXT2_IND_BLOCK]);
if (ret == 0)
ret = ib_a->inode.i_file_acl - ib_b->inode.i_file_acl;
+ if (ret == 0)
+ ret = ib_a->ino - ib_b->ino;
return ret;
}
diff --git a/e2fsck/region.c b/e2fsck/region.c
index 0cec6a92..e50c8a44 100644
--- a/e2fsck/region.c
+++ b/e2fsck/region.c
@@ -14,6 +14,9 @@
#endif
#include <string.h>
+#ifdef TEST_PROGRAM
+#undef ENABLE_NLS
+#endif
#include "e2fsck.h"
struct region_el {