*/
/*
- * 09.11.91 - made the first rudimetary functions
+ * 09.11.91 - made the first rudimentary functions
*
* 10.11.91 - updated, does checking, no repairs yet.
* Sent out to the mailing-list for testing.
* 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such
* for modern libcs (janl@math.uio.no, Nicolai Langfeldt)
*
- * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk
+ * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk
* (Russell King). He made them for ARM. It would seem
* that the ARM is powerful enough to do this in C whereas
* i386 and m64k must use assembly to get it fast >:-)
- * This should make minix fsck systemindependent.
+ * This should make minix fsck system-independent.
* (janl@math.uio.no, Nicolai Langfeldt)
*
* 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler
- * warnings. Added mc68k bitops from
+ * warnings. Added mc68k bitops from
* Joerg Dorchain <dorchain@mpi-sb.mpg.de>.
*
* 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by
* unless you can be sure nobody is writing to it (and remember that the
* kernel can write to it when it searches for files).
*
- * Usuage: fsck [-larvsm] device
+ * Usage: fsck [-larvsm] device
* -l for a listing of all the filenames
* -a for automatic repairs (not implemented)
* -r for repairs (interactive) (not implemented)
* -f force filesystem check even if filesystem marked as valid
*
* The device may be a block device or a image of one, but this isn't
- * enforced (but it's not much fun on a character device :-).
+ * enforced (but it's not much fun on a character device :-).
*/
#include <stdio.h>
* Note the 8-bit gid and atime and ctime.
*/
struct minix_inode {
- u_int16_t i_mode;
- u_int16_t i_uid;
- u_int32_t i_size;
- u_int32_t i_time;
- u_int8_t i_gid;
- u_int8_t i_nlinks;
- u_int16_t i_zone[9];
+ uint16_t i_mode;
+ uint16_t i_uid;
+ uint32_t i_size;
+ uint32_t i_time;
+ uint8_t i_gid;
+ uint8_t i_nlinks;
+ uint16_t i_zone[9];
};
/*
* now 16-bit. The inode is now 64 bytes instead of 32.
*/
struct minix2_inode {
- u_int16_t i_mode;
- u_int16_t i_nlinks;
- u_int16_t i_uid;
- u_int16_t i_gid;
- u_int32_t i_size;
- u_int32_t i_atime;
- u_int32_t i_mtime;
- u_int32_t i_ctime;
- u_int32_t i_zone[10];
+ uint16_t i_mode;
+ uint16_t i_nlinks;
+ uint16_t i_uid;
+ uint16_t i_gid;
+ uint32_t i_size;
+ uint32_t i_atime;
+ uint32_t i_mtime;
+ uint32_t i_ctime;
+ uint32_t i_zone[10];
};
/*
* minix super-block data on disk
*/
struct minix_super_block {
- u_int16_t s_ninodes;
- u_int16_t s_nzones;
- u_int16_t s_imap_blocks;
- u_int16_t s_zmap_blocks;
- u_int16_t s_firstdatazone;
- u_int16_t s_log_zone_size;
- u_int32_t s_max_size;
- u_int16_t s_magic;
- u_int16_t s_state;
- u_int32_t s_zones;
+ uint16_t s_ninodes;
+ uint16_t s_nzones;
+ uint16_t s_imap_blocks;
+ uint16_t s_zmap_blocks;
+ uint16_t s_firstdatazone;
+ uint16_t s_log_zone_size;
+ uint32_t s_max_size;
+ uint16_t s_magic;
+ uint16_t s_state;
+ uint32_t s_zones;
};
struct minix_dir_entry {
- u_int16_t inode;
+ uint16_t inode;
char name[0];
};
static void die(const char *str)
{
- error_msg("%s", str);
+ bb_error_msg("%s", str);
leave(8);
}
{
int i;
- if (name_list) {
+ if (name_list) {
for (i = 0; i < MAX_DEPTH; i++) {
free(name_list[i]);
}
argv++;
if (argv[0][0] != '-') {
if (device_name)
- show_usage();
+ bb_show_usage();
else
device_name = argv[0];
} else
force = 1;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
if (!device_name)
- show_usage();
+ bb_show_usage();
check_mount(); /* trying to check a mounted filesystem? */
if (repair && !automatic) {
if (!isatty(0) || !isatty(1))
/*
* Determine whether or not we should continue with the checking.
* This is based on the status of the filesystem valid and error
- * flags and whether or not the -f switch was specified on the
+ * flags and whether or not the -f switch was specified on the
* command line.
*/
- printf("%s, %s\n", applet_name, program_version);
+ printf("%s, %s\n", bb_applet_name, program_version);
if (!(Super.s_state & MINIX_ERROR_FS) &&
(Super.s_state & MINIX_VALID_FS) && !force) {
if (repair)