Skip to content

Commit

Permalink
events: even better error messages for partial write (#636)
Browse files Browse the repository at this point in the history
#622 helped with this, but it's still overly laconic about what's going
on. I think this is better.
  • Loading branch information
pkova authored Jul 31, 2024
2 parents 3e6219d + 99b0423 commit d8f4ac0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/noun/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,12 @@ _ce_patch_write_page(u3_ce_patch* pat_u,
(ret_zs = pwrite(pat_u->mem_i, mem_w, _ce_page, _ce_len(pgc_w))) )
{
if ( 0 < ret_zs ) {
fprintf(stderr, "loom: patch partial write: %"PRIc3_zs", check disk space\r\n", ret_zs);
fprintf(stderr, "loom: patch partial write: %"PRIc3_zs"\r\n", ret_zs);
}
else {
fprintf(stderr, "loom: patch write: fail: %s, check disk space\r\n", strerror(errno));
fprintf(stderr, "loom: patch write: fail: %s\r\n", strerror(errno));
}
fprintf(stderr, "info: you probably have insufficient disk space");
u3_assert(0);
}
}
Expand Down Expand Up @@ -873,12 +874,13 @@ _ce_patch_apply(u3_ce_patch* pat_u)
(ret_zs = pwrite(fid_i, buf_y, _ce_page, off_z)) )
{
if ( 0 < ret_zs ) {
fprintf(stderr, "loom: patch apply partial write: %"PRIc3_zs", check disk space\r\n",
fprintf(stderr, "loom: patch apply partial write: %"PRIc3_zs"\r\n",
ret_zs);
}
else {
fprintf(stderr, "loom: patch apply write: %s, check disk space\r\n", strerror(errno));
fprintf(stderr, "loom: patch apply write: %s\r\n", strerror(errno));
}
fprintf(stderr, "info: you probably have insufficient disk space");
u3_assert(0);
}
}
Expand Down Expand Up @@ -1325,13 +1327,14 @@ _ce_image_copy(u3e_image* fom_u, u3e_image* tou_u)
}
if ( _ce_page != (ret_i = write(tou_u->fid_i, buf_y, _ce_page)) ) {
if ( 0 < ret_i ) {
fprintf(stderr, "loom: image (%s) copy partial write: %zu, check disk space\r\n",
fprintf(stderr, "loom: image (%s) copy partial write: %zu\r\n",
tou_u->nam_c, (size_t)ret_i);
}
else {
fprintf(stderr, "loom: image (%s) copy write: %s, check disk space\r\n",
fprintf(stderr, "loom: image (%s) copy write: %s\r\n",
tou_u->nam_c, strerror(errno));
}
fprintf(stderr, "info: you probably have insufficient disk space");
return c3n;
}
}
Expand Down

0 comments on commit d8f4ac0

Please sign in to comment.