]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
minix: replace magic constants with macro names
authorSami Kerola <kerolasa@iki.fi>
Sun, 16 Dec 2012 10:43:59 +0000 (10:43 +0000)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Dec 2012 10:38:56 +0000 (11:38 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/fsck.minix.c
disk-utils/mkfs.minix.c

index 6189b0bf402bdfbee7268fb2cb86e3f6c8b689e3..8e9ee2253cd5f83b886e0b6b1d45d89fed76f73a 100644 (file)
@@ -168,7 +168,7 @@ static char *zone_map;
 static void
 reset(void) {
        if (termios_set)
-               tcsetattr(0, TCSANOW, &termios);
+               tcsetattr(STDIN_FILENO, TCSANOW, &termios);
 }
 
 static void
@@ -294,7 +294,7 @@ check_mount(void) {
                return;
 
        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);
        else
                cont = 0;
@@ -1238,7 +1238,7 @@ int
 main(int argc, char **argv) {
        struct termios tmp;
        int count;
-       int retcode = 0;
+       int retcode = FSCK_EX_OK;
 
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
@@ -1297,7 +1297,7 @@ main(int argc, char **argv) {
                usage();
        check_mount();          /* trying to check a mounted filesystem? */
        if (repair && !automatic) {
-               if (!isatty(0) || !isatty(1))
+               if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO))
                        die(_("need terminal for interactive repairs"));
        }
        IN = open(device_name, repair ? O_RDWR : O_RDONLY);
@@ -1330,10 +1330,10 @@ main(int argc, char **argv) {
        signal(SIGTERM, fatalsig);
 
        if (repair && !automatic) {
-               tcgetattr(0, &termios);
+               tcgetattr(STDIN_FILENO, &termios);
                tmp = termios;
                tmp.c_lflag &= ~(ICANON | ECHO);
-               tcsetattr(0, TCSANOW, &tmp);
+               tcsetattr(STDIN_FILENO, TCSANOW, &tmp);
                termios_set = 1;
        }
 
@@ -1381,7 +1381,7 @@ main(int argc, char **argv) {
                write_super_block();
 
        if (repair && !automatic)
-               tcsetattr(0, TCSANOW, &termios);
+               tcsetattr(STDIN_FILENO, TCSANOW, &termios);
 
        if (changed)
                retcode += 3;
index b445c0c6ca5ce5e6e1dbe620972e451f9a2c0129..bbfee3291029c87d8ec0b31877d95cb3e5956d18 100644 (file)
@@ -666,7 +666,7 @@ int main(int argc, char ** argv) {
        if (argc == 2 &&
            (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
                printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
-               exit(0);
+               exit(MKFS_EX_OK);
        }
 
        if (INODE_SIZE * MINIX_INODES_PER_BLOCK != MINIX_BLOCK_SIZE)
@@ -806,5 +806,5 @@ int main(int argc, char ** argv) {
        write_tables();
        close(DEV);
 
-       return 0;
+       return MKFS_EX_OK;
 }