Fix the "only wrote -1 of 32768 bytes: Input/output error" error message.

This commit is contained in:
Ruslan Ermilov 2005-05-13 20:06:44 +00:00
parent fdace17f81
commit de6a1361a5

View File

@ -630,8 +630,11 @@ write_file(int fd, struct track_info *track_info)
track_info->block_size;
}
if ((res = write(fd, buf, count)) != count) {
fprintf(stderr, "\nonly wrote %d of %jd bytes: %s\n",
res, (intmax_t)count, strerror(errno));
if (res == -1)
fprintf(stderr, "\n%s\n", strerror(errno));
else
fprintf(stderr, "\nonly wrote %d of %jd"
" bytes\n", res, (intmax_t)count);
break;
}
size += count;