minix: replace magic constants with macro names

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-12-16 10:43:59 +00:00 committed by Karel Zak
parent a180dc6c54
commit 65ca6f8382
2 changed files with 9 additions and 9 deletions

View File

@ -168,7 +168,7 @@ static char *zone_map;
static void static void
reset(void) { reset(void) {
if (termios_set) if (termios_set)
tcsetattr(0, TCSANOW, &termios); tcsetattr(STDIN_FILENO, TCSANOW, &termios);
} }
static void static void
@ -294,7 +294,7 @@ check_mount(void) {
return; return;
printf(_("%s is mounted. "), device_name); printf(_("%s is mounted. "), device_name);
if (isatty(0) && isatty(1)) if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
cont = ask(_("Do you really want to continue"), 0); cont = ask(_("Do you really want to continue"), 0);
else else
cont = 0; cont = 0;
@ -1238,7 +1238,7 @@ int
main(int argc, char **argv) { main(int argc, char **argv) {
struct termios tmp; struct termios tmp;
int count; int count;
int retcode = 0; int retcode = FSCK_EX_OK;
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
@ -1297,7 +1297,7 @@ main(int argc, char **argv) {
usage(); usage();
check_mount(); /* trying to check a mounted filesystem? */ check_mount(); /* trying to check a mounted filesystem? */
if (repair && !automatic) { if (repair && !automatic) {
if (!isatty(0) || !isatty(1)) if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO))
die(_("need terminal for interactive repairs")); die(_("need terminal for interactive repairs"));
} }
IN = open(device_name, repair ? O_RDWR : O_RDONLY); IN = open(device_name, repair ? O_RDWR : O_RDONLY);
@ -1330,10 +1330,10 @@ main(int argc, char **argv) {
signal(SIGTERM, fatalsig); signal(SIGTERM, fatalsig);
if (repair && !automatic) { if (repair && !automatic) {
tcgetattr(0, &termios); tcgetattr(STDIN_FILENO, &termios);
tmp = termios; tmp = termios;
tmp.c_lflag &= ~(ICANON | ECHO); tmp.c_lflag &= ~(ICANON | ECHO);
tcsetattr(0, TCSANOW, &tmp); tcsetattr(STDIN_FILENO, TCSANOW, &tmp);
termios_set = 1; termios_set = 1;
} }
@ -1381,7 +1381,7 @@ main(int argc, char **argv) {
write_super_block(); write_super_block();
if (repair && !automatic) if (repair && !automatic)
tcsetattr(0, TCSANOW, &termios); tcsetattr(STDIN_FILENO, TCSANOW, &termios);
if (changed) if (changed)
retcode += 3; retcode += 3;

View File

@ -666,7 +666,7 @@ int main(int argc, char ** argv) {
if (argc == 2 && if (argc == 2 &&
(!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) { (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
printf(_("%s (%s)\n"), program_name, PACKAGE_STRING); printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
exit(0); exit(MKFS_EX_OK);
} }
if (INODE_SIZE * MINIX_INODES_PER_BLOCK != MINIX_BLOCK_SIZE) if (INODE_SIZE * MINIX_INODES_PER_BLOCK != MINIX_BLOCK_SIZE)
@ -806,5 +806,5 @@ int main(int argc, char ** argv) {
write_tables(); write_tables();
close(DEV); close(DEV);
return 0; return MKFS_EX_OK;
} }