1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

When there is a problem with writing, also bail out.

Found with the clang checker.
This commit is contained in:
Edwin Groothuis 2010-06-05 12:49:39 +00:00
parent 43a7b5c3e1
commit 3b8d8bd75e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208830

View File

@ -564,7 +564,8 @@ install_zoneinfo_file(const char *zoneinfo_file)
}
while ((len = read(fd1, buf, sizeof(buf))) > 0)
len = write(fd2, buf, len);
if ((len = write(fd2, buf, len)) < 0)
break;
if (len == -1) {
snprintf(title, sizeof(title), "Error");