diff options
-rw-r--r-- | init/initramfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index a7566031242e..bece48c3461e 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -369,7 +369,8 @@ static int __init do_name(void) | |||
369 | static int __init do_copy(void) | 369 | static int __init do_copy(void) |
370 | { | 370 | { |
371 | if (count >= body_len) { | 371 | if (count >= body_len) { |
372 | xwrite(wfd, victim, body_len); | 372 | if (xwrite(wfd, victim, body_len) != body_len) |
373 | error("write error"); | ||
373 | sys_close(wfd); | 374 | sys_close(wfd); |
374 | do_utime(vcollected, mtime); | 375 | do_utime(vcollected, mtime); |
375 | kfree(vcollected); | 376 | kfree(vcollected); |
@@ -377,7 +378,8 @@ static int __init do_copy(void) | |||
377 | state = SkipIt; | 378 | state = SkipIt; |
378 | return 0; | 379 | return 0; |
379 | } else { | 380 | } else { |
380 | xwrite(wfd, victim, count); | 381 | if (xwrite(wfd, victim, count) != count) |
382 | error("write error"); | ||
381 | body_len -= count; | 383 | body_len -= count; |
382 | eat(count); | 384 | eat(count); |
383 | return 1; | 385 | return 1; |