From 5629153f1eadc2b27dd48ff18a194f6819d9d732 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 26 Jan 1994 18:19:10 +0000 Subject: . --- src/install.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/install.c') diff --git a/src/install.c b/src/install.c index 7c6a5d2f7..77617b02a 100644 --- a/src/install.c +++ b/src/install.c @@ -105,6 +105,8 @@ char *basename (); char *stpcpy (); char *xmalloc (); void error (); +int safe_read (); +int full_write (); int make_path (); int isdir (); @@ -374,8 +376,8 @@ copy_file (from, to, to_created) return 1; } - while ((bytes = read (fromfd, buffer, READ_SIZE)) > 0) - if (write (tofd, buffer, bytes) != bytes) + while ((bytes = safe_read (fromfd, buffer, READ_SIZE)) > 0) + if (full_write (tofd, buffer, bytes) < 0) { error (0, errno, "%s", to); goto copy_error; -- cgit v1.2.3-70-g09d2