From e6597048d9d1637c9f997363a7f45c74b98fd0e2 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 26 Oct 1999 02:30:16 +0000 Subject: [PATCH] ChangeLog, mke2fs.c: mke2fs.c (PRS): Use __u64 instead of long long for portability reasons. Moved #include of sys/stat.h inside #ifdef HAVE_LINUX_MAJOR_H for portability reasons. ChangeLog, util.c: util.c: For NT portability, don't redefine getchar(), since stdio defines that. Instead we introduce a new abstract macro read_a_char() which is #defined to the right function as necessary. --- e2fsck/ChangeLog | 5 +++++ e2fsck/util.c | 7 +++++-- misc/ChangeLog | 3 +++ misc/mke2fs.c | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 39f35c2..c94de21 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,10 @@ 1999-10-25 + * util.c: For NT portability, don't redefine getchar(), since + stdio defines that. Instead we introduce a new + abstract macro read_a_char() which is #defined to the + right function as necessary. + * problem.c, problem.h (PR_2_NULL_NAME): Add new problem code. * pass2.c (check_dir_block): Require that the length of the diff --git a/e2fsck/util.c b/e2fsck/util.c index a124a0f..fdba677 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -17,11 +17,14 @@ #ifdef HAVE_CONIO_H #undef HAVE_TERMIOS_H #include -#define getchar() getch() +#define read_a_char() getch() #else #ifdef HAVE_TERMIOS_H #include #endif +#else /* !HAVE_CONIO_H */ +#include +#define read_a_char getchar() #endif #ifdef HAVE_MALLOC_H @@ -86,7 +89,7 @@ int ask_yn(const char * string, int def) printf("%s%s? ", string, defstr); while (1) { fflush (stdout); - if ((c = getchar()) == EOF) + if ((c = read_a_char()) == EOF) break; c = toupper(c); if (c == 'Y') { diff --git a/misc/ChangeLog b/misc/ChangeLog index 6f38099..508aafb 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -2,6 +2,9 @@ * mke2fs.c (show_stats): Capitalized Hurd to make the GNU types happy. + (PRS): Use __u64 instead of long long for portability + reasons. Also moved #include of sys/stat.h inside #ifdef + HAVE_LINUX_MAJOR_H for portability reasons. * fsck.c (execute): Fix really stupid bug in the linked list management which caused fsck in parallel mode to go into diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 1c1c19a..5ab30eb 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -40,7 +40,6 @@ #endif #include #include -#include #ifdef HAVE_LINUX_FS_H #include @@ -48,6 +47,7 @@ #include #ifdef HAVE_LINUX_MAJOR_H #include +#include /* Only need sys/stat.h for major nr test */ #endif #include "et/com_err.h" @@ -952,7 +952,7 @@ static void PRS(int argc, char *argv[]) * Calculate number of inodes based on the inode ratio */ param.s_inodes_count = num_inodes ? num_inodes : - ((long long) param.s_blocks_count * EXT2_BLOCK_SIZE(¶m)) + ((__u64) param.s_blocks_count * EXT2_BLOCK_SIZE(¶m)) / inode_ratio; /* -- 1.8.3.1