summaryrefslogtreecommitdiff
path: root/src/head.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-03-24 16:59:11 +0000
committerJim Meyering <jim@meyering.net>1996-03-24 16:59:11 +0000
commit818d29db9bee7b3a87d677bb4bdd520b30924fad (patch)
tree4994682f8e7be50460c142ee85321f4e5f3a29e6 /src/head.c
parent47f70113d4342682a6408f85337676f1ccb7e8fe (diff)
downloadcoreutils-818d29db9bee7b3a87d677bb4bdd520b30924fad.tar.xz
Call error with EXIT_FAILURE (rather than `1') as first actual parameter.
Diffstat (limited to 'src/head.c')
-rw-r--r--src/head.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/head.c b/src/head.c
index f3f8a9ee5..2ef9dea96 100644
--- a/src/head.c
+++ b/src/head.c
@@ -175,7 +175,7 @@ head_bytes (const char *filename, int fd, long int bytes_to_write)
if (bytes_read > bytes_to_write)
bytes_read = bytes_to_write;
if (fwrite (buffer, 1, bytes_read, stdout) == 0)
- error (1, errno, _("write error"));
+ error (EXIT_FAILURE, errno, _("write error"));
bytes_to_write -= bytes_read;
}
return 0;
@@ -203,7 +203,7 @@ head_lines (const char *filename, int fd, long int lines_to_write)
if (buffer[bytes_to_write++] == '\n' && --lines_to_write == 0)
break;
if (fwrite (buffer, 1, bytes_to_write, stdout) == 0)
- error (1, errno, _("write error"));
+ error (EXIT_FAILURE, errno, _("write error"));
}
return 0;
}
@@ -334,7 +334,7 @@ main (int argc, char **argv)
/* FIXME: use xstrtoul instead. */
number = atou (optarg);
if (number == -1)
- error (1, 0, _("invalid number `%s'"), optarg);
+ error (EXIT_FAILURE, 0, _("invalid number `%s'"), optarg);
break;
case 'q':
@@ -376,9 +376,9 @@ main (int argc, char **argv)
exit_status |= head_file (argv[optind], number);
if (have_read_stdin && close (0) < 0)
- error (1, errno, "-");
+ error (EXIT_FAILURE, errno, "-");
if (fclose (stdout) == EOF)
- error (1, errno, _("write error"));
+ error (EXIT_FAILURE, errno, _("write error"));
exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}