From de6a1361a5d5f8d79402071ccd28948e041f3ee4 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 13 May 2005 20:06:44 +0000 Subject: [PATCH] Fix the "only wrote -1 of 32768 bytes: Input/output error" error message. --- usr.sbin/burncd/burncd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/burncd/burncd.c b/usr.sbin/burncd/burncd.c index aaf0b06f3990..2800f5236be5 100644 --- a/usr.sbin/burncd/burncd.c +++ b/usr.sbin/burncd/burncd.c @@ -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;