summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-01-26 18:19:10 +0000
committerJim Meyering <jim@meyering.net>1994-01-26 18:19:10 +0000
commit5629153f1eadc2b27dd48ff18a194f6819d9d732 (patch)
tree60428c4cc180a9940e5d85ae62154f60dfde43f1 /src/install.c
parent2b16e3652c9625a41bbe9a1573316a5c1e65141b (diff)
downloadcoreutils-5629153f1eadc2b27dd48ff18a194f6819d9d732.tar.xz
.
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c6
1 files changed, 4 insertions, 2 deletions
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;