Skip to content

Commit

Permalink
disk/events: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Jul 18, 2023
1 parent 3c8c0b2 commit 1556567
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions pkg/noun/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,12 +1344,12 @@ c3_o
u3e_backup(c3_c* pux_c, c3_c* pax_c, c3_o ovw_o)
{
// source image files from [pux_c]
u3e_image nux_u = { .nam_c = "north" };
u3e_image sux_u = { .nam_c = "south" };
u3e_image nux_u = { .nam_c = "north", .pgs_w = 0 };
u3e_image sux_u = { .nam_c = "south", .pgs_w = 0 };

// destination image files to [pax_c]
u3e_image nax_u = { .nam_c = "north" };
u3e_image sax_u = { .nam_c = "south" };
u3e_image nax_u = { .nam_c = "north", .pgs_w = 0 };
u3e_image sax_u = { .nam_c = "south", .pgs_w = 0 };

c3_i mod_i = O_RDWR | O_CREAT;

Expand Down
10 changes: 4 additions & 6 deletions pkg/vere/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,12 +1044,10 @@ u3_disk_init(c3_c* pax_c, u3_disk_cb cb_u, c3_o mig_o)
}

if ( c3y == u3_disk_need_migrate(log_u) ) {
if ( c3y == mig_o ) {
if ( c3n == u3_disk_migrate(log_u) ) {
fprintf(stderr, "disk: failed to migrate log\r\n");
c3_free(log_u);
return 0;
}
if ( (c3y == mig_o) && (c3n == u3_disk_migrate(log_u)) ) {
fprintf(stderr, "disk: failed to migrate log\r\n");
c3_free(log_u);
return 0;
}
else {
fprintf(stderr, "disk: loading old format\r\n");
Expand Down

0 comments on commit 1556567

Please sign in to comment.