diff options
Diffstat (limited to 'src/cat.c')
-rw-r--r-- | src/cat.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -34,6 +34,7 @@ #include "system.h" #include "ioblksize.h" +#include "die.h" #include "error.h" #include "fadvise.h" #include "full-write.h" @@ -183,7 +184,7 @@ simple_cat ( /* The following is ok, since we know that 0 < n_read. */ size_t n = n_read; if (full_write (STDOUT_FILENO, buf, n) != n) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); } } } @@ -199,7 +200,7 @@ write_pending (char *outbuf, char **bpout) if (0 < n_write) { if (full_write (STDOUT_FILENO, outbuf, n_write) != n_write) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); *bpout = outbuf; } } @@ -283,7 +284,7 @@ cat ( do { if (full_write (STDOUT_FILENO, wp, outsize) != outsize) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); wp += outsize; remaining_bytes = bpout - wp; } @@ -634,7 +635,7 @@ main (int argc, char **argv) /* Get device, i-node number, and optimal blocksize of output. */ if (fstat (STDOUT_FILENO, &stat_buf) < 0) - error (EXIT_FAILURE, errno, _("standard output")); + die (EXIT_FAILURE, errno, _("standard output")); outsize = io_blksize (stat_buf); out_dev = stat_buf.st_dev; @@ -761,7 +762,7 @@ main (int argc, char **argv) while (++argind < argc); if (have_read_stdin && close (STDIN_FILENO) < 0) - error (EXIT_FAILURE, errno, _("closing standard input")); + die (EXIT_FAILURE, errno, _("closing standard input")); return ok ? EXIT_SUCCESS : EXIT_FAILURE; } |