Whamcloud - gitweb
ChangeLog, mke2fs.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 26 Oct 1999 02:30:16 +0000 (02:30 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Oct 1999 02:30:16 +0000 (02:30 +0000)
  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
e2fsck/util.c
misc/ChangeLog
misc/mke2fs.c

index 39f35c2..c94de21 100644 (file)
@@ -1,5 +1,10 @@
 1999-10-25    <tytso@valinux.com>
 
+       * 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
index a124a0f..fdba677 100644 (file)
 #ifdef HAVE_CONIO_H
 #undef HAVE_TERMIOS_H
 #include <conio.h>
-#define getchar()      getch()
+#define read_a_char()  getch()
 #else
 #ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #endif
+#else /* !HAVE_CONIO_H */
+#include <stdio.h>
+#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') {
index 6f38099..508aafb 100644 (file)
@@ -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
index 1c1c19a..5ab30eb 100644 (file)
@@ -40,7 +40,6 @@
 #endif
 #include <sys/ioctl.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 
 #ifdef HAVE_LINUX_FS_H
 #include <linux/fs.h>
@@ -48,6 +47,7 @@
 #include <linux/ext2_fs.h>
 #ifdef HAVE_LINUX_MAJOR_H
 #include <linux/major.h>
+#include <sys/stat.h>          /* 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(&param))
+               ((__u64) param.s_blocks_count * EXT2_BLOCK_SIZE(&param))
                        / inode_ratio;
 
        /*