From 818d29db9bee7b3a87d677bb4bdd520b30924fad Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 24 Mar 1996 16:59:11 +0000 Subject: Call error with EXIT_FAILURE (rather than `1') as first actual parameter. --- src/head.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/head.c') 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); } -- cgit v1.2.3-70-g09d2