summaryrefslogtreecommitdiff
path: root/src/cat.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-03-24 14:58:01 +0000
committerJim Meyering <jim@meyering.net>1996-03-24 14:58:01 +0000
commit47f70113d4342682a6408f85337676f1ccb7e8fe (patch)
treee0a69d9a12ac5b336364cc0191f2390d5061fd50 /src/cat.c
parent2fa0c16e5e11ff23fb4e57246a21d9d0ef731caa (diff)
downloadcoreutils-47f70113d4342682a6408f85337676f1ccb7e8fe.tar.xz
Exit with status EXIT_SUCCESS or EXIT_FAILURE, rather than 0 or 1.
This doesn't change `error (1' calls.
Diffstat (limited to 'src/cat.c')
-rw-r--r--src/cat.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cat.c b/src/cat.c
index e141e4d68..f899e117b 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -72,7 +72,7 @@ static char *line_num_end = line_buf + 10;
static int newlines2 = 0;
/* Count of non-fatal error conditions. */
-static int exit_stat = 0;
+static int exit_status = 0;
static void
usage (int status)
@@ -105,7 +105,7 @@ Concatenate FILE(s), or standard input, to standard output.\n\
With no FILE, or when FILE is -, read standard input.\n\
"));
}
- exit (status);
+ exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/* Compute the next line number. */
@@ -151,7 +151,7 @@ simple_cat (
if (n_read < 0)
{
error (0, errno, "%s", infile);
- exit_stat = 1;
+ exit_status = 1;
return;
}
@@ -286,7 +286,7 @@ cat (
else
{
error (0, errno, _("cannot do ioctl on `%s'"), infile);
- exit_stat = 1;
+ exit_status = 1;
newlines2 = newlines;
return;
}
@@ -307,7 +307,7 @@ cat (
if (n_read < 0)
{
error (0, errno, "%s", infile);
- exit_stat = 1;
+ exit_status = 1;
newlines2 = newlines;
return;
}
@@ -573,14 +573,14 @@ main (int argc, char **argv)
break;
default:
- usage (2);
+ usage (EXIT_FAILURE);
}
}
if (show_version)
{
printf ("cat - %s\n", PACKAGE_VERSION);
- exit (0);
+ exit (EXIT_SUCCESS);
}
if (show_help)
@@ -637,7 +637,7 @@ main (int argc, char **argv)
if (input_desc < 0)
{
error (0, errno, "%s", infile);
- exit_stat = 1;
+ exit_status = 1;
continue;
}
}
@@ -645,7 +645,7 @@ main (int argc, char **argv)
if (fstat (input_desc, &stat_buf) < 0)
{
error (0, errno, "%s", infile);
- exit_stat = 1;
+ exit_status = 1;
goto contin;
}
insize = ST_BLKSIZE (stat_buf);
@@ -660,7 +660,7 @@ main (int argc, char **argv)
&& (input_desc != fileno (stdin) || output_desc != fileno (stdout)))
{
error (0, 0, _("%s: input file is output file"), infile);
- exit_stat = 1;
+ exit_status = 1;
goto contin;
}
@@ -710,7 +710,7 @@ main (int argc, char **argv)
if (strcmp (infile, "-") && close (input_desc) < 0)
{
error (0, errno, "%s", infile);
- exit_stat = 1;
+ exit_status = 1;
}
}
while (++argind < argc);
@@ -720,5 +720,5 @@ main (int argc, char **argv)
if (close (1) < 0)
error (1, errno, _("write error"));
- exit (exit_stat);
+ exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}