public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 11/14] minix: replace magic constants with macro names
Date: Sun, 16 Dec 2012 10:43:59 +0000	[thread overview]
Message-ID: <1355654642-22106-12-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1355654642-22106-1-git-send-email-kerolasa@iki.fi>

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 disk-utils/fsck.minix.c | 14 +++++++-------
 disk-utils/mkfs.minix.c |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c
index 6189b0b..8e9ee22 100644
--- a/disk-utils/fsck.minix.c
+++ b/disk-utils/fsck.minix.c
@@ -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;
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index b445c0c..bbfee32 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -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;
 }
-- 
1.8.0.2


  parent reply	other threads:[~2012-12-16 10:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16 10:43 [00/14]: pull: ipcs resubmission, bug fixes, minix todo, etc Sami Kerola
2012-12-16 10:43 ` [PATCH 01/14] docs: swapon.8 option name fix Sami Kerola
2012-12-16 10:43 ` [PATCH 02/14] ipcs: assist debugging Sami Kerola
2012-12-16 10:43 ` [PATCH 03/14] ipcs: add --human readable size conversion option Sami Kerola
2012-12-16 10:43 ` [PATCH 04/14] ipcs: add --bytes size output option Sami Kerola
2012-12-16 10:43 ` [PATCH 05/14] isosize: fix usage() -h option print out Sami Kerola
2012-12-16 10:43 ` [PATCH 06/14] isosize: inform if file does not look like iso file system Sami Kerola
2012-12-16 10:43 ` [PATCH 07/14] more: remove unnecessary variable Sami Kerola
2012-12-16 10:43 ` [PATCH 08/14] tunelp: deprecation: remove command from default build Sami Kerola
2012-12-16 10:43 ` [PATCH 09/14] minix: change types in header file Sami Kerola
2012-12-16 10:43 ` [PATCH 10/14] minix: use off_t, size_t, etc appropriate types Sami Kerola
2012-12-16 10:43 ` Sami Kerola [this message]
2012-12-16 10:44 ` [PATCH 12/14] docs: add missing exit value to fsck.minix(8) Sami Kerola
2012-12-16 10:44 ` [PATCH 13/14] lib/ismounted: detect loopback mounts Sami Kerola
2012-12-19 13:38   ` Karel Zak
2012-12-16 10:44 ` [PATCH 14/14] docs: fsck(8), mkfs(8): update manual references Sami Kerola
2012-12-19 13:54   ` Karel Zak
2012-12-19 14:29 ` [00/14]: pull: ipcs resubmission, bug fixes, minix todo, etc Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355654642-22106-12-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox